Introduction: Progressive Detail Moon Lamp
This Instructables show how to push the limit of your 3D printer to print a finest Moon lamp.
Step 1: 3D Modelling Moon Lamp
This is my 3rd instructables about 3D Modelling a Moon lamp. From subsequent trials and errors, I have accumulated experience in various scopes to make it better. I will share all the factors in this instructables.
I would like this instructables be a completed guide for this topics, so I also consolidated some of the previous instructables detail here.
My previous instructables:
Step 2: Why Self Make It?
There are various 3D Moon lamp you can found on the web.
You can download and print one, e.g.: https://www.thingiverse.com/thing:2032190
Or you can direct order one, e.g.: diymoonlamp.com
But I am not satisfy the quality of existing Moon Lamp Model, especially when the light turned off, it simply not look like a Moon. So I started a 3 years journey of exploring how to 3D modelling a better Moon Lamp. I have made 3 generation now, each generation is a great milestone. I think I am nearly reach the destination when writing this instuctables ;)
The above first picture from left to right is 3rd generation Moon Lamp, 2nd generation Moon Lamp and diymoonlamp.
Step 3: Map Data
We require some map data for 3D modelling a Moon. When you search Moon map on the web, you can find 2 type of Moon map data:
Moon Bump Map
Bump map (or called surface map, height map or displacement map) is the map data for modelling 3D surface. The grayscale value in each pixel represent the height of the corresponding point at the sphere. Moon bump map recorded the Moon actual height detail, but when you direct read the bump map image it is not very like the Moon you can see in the sky.
Moon Color Map
When you see the Moon in the sky, the visual details is not only based on the surface height on each point, It also based on the land surface material color. The image of the visual data is called color map.
Step 4: High Resolution Map Data
At the beginning, I am using the map data at the resolution 720x360 only. I think it is good enough at that time.
However, when I zoom in the photo I took the Moon in the sky, there are much more details. Then I use the map data at 2048x1024, but I still found the resolution is not enough. And also most free map data have some distraction detail on it, e.g. reflectance and shadow. I would like to eliminate it.
Tuomas Kankola have spent substantial effort to "manually cleaned up a reflectance map of the entire Moon", so I decide paid for his effort instead of do it myself.
since the map data is not free, I do not upload the original image to Github, the version at Github is only a lower resolution version that you can find on the web. The final output STL posted to Thingiverse is generated from a higher resolution map data at 23K (23040x11520).
Step 5: Modelling Sphere Lamp Like a Moon
Ok, we have very good map data now, then how can we 3D modelling a sphere lamp like a Moon?
When the lamp turned off
The Moon lamp should be able to show the Moon actual surface details. It is relatively simple, most 3D modelling software can use bump map data to make it.
When the lamp turned on
The Moon lamp should look like the Moon we can see in the sky, i.e. the details of color map. Yet we can direct 3D print different colors easily, fortunately Moon nearly look like in grayscale. We can use the shell thickness to adjust how much light goes out from the shell, so that we can project a grayscale image on the sphere lamp. This technique is called Lithophane. It is not a new 3D print invented technique, it already appear nearly 200 years.
The sphere modelling with bump map is a solid object with surface details. As a lamp shade, we need to make it hollow. The shell thickness on each point depends on the color map value, thicker means dimmer (darker).
Step 6: Clear Lithophane Details
The projected color map details in my first Moon lamp model is a little bit too blurry, the color map have many meteor crater and river details but all are blurred.
The blurry should be caused by hiding all color map details in model inside. The above 2 pictures, first one is a Moon lithophane with detail side facing up, second one is the same lithophane facing down. The second picture is much blurry, this example can demonstrate lithophane details should not all hided inside.
Step 7: Adjust Surface Map
The surface is originally modelling from Moon bump map. Now we also want part of the color map details on the surface, how can we do that?
I have tried many methods to make it, Some methods are very complicated. Finally I found the best one, it also a simple one. It simply just add two image value together.
Here are the processing script with imagemagick:
#!/bin/sh #grayscale and gamma adjustment convert Moon_23k_Color_v001.tif -type grayscale -level 0,100%,1.8 moonColorMap.23k.png convert Moon_23k_Disp_v002.tif -type grayscale -level 0,100%,1.8 moonBumpMap.23k.png #invert color map and shift level for addition operation convert moonColorMap.23k.png -negate +level 0,50% invertedColorMap.5.tif convert moonBumpMap.23k.png +level 0,50% bumpMap.5.tif #add 2 map together convert invertedColorMap.5.tif bumpMap.5.tif -background black -compose plus -layers flatten moonBumpAddInvertedColorMap.23k.png
Step 8: 3D Modelling Software
Many 3D modelling software can use a bump map to modelling a spherical object, but the result object is solid inside.
I have the Moon lamp shade idea some times ago but I cannot find any existing software that can modelling a hollow spherical object using 2 map data at the same time.
Fortunately, I found BanateCAD. It is a 3D modelling program written in Lua scripting language. It also can use bump map to modelling a spherical object. I have made some bug fix, added some features and enhanced it to use the color map to modelling hollow spherical object shell thickness.
You can find my revised version of BanateCAD at GitHub:
After clone the repository, you can find the modelling script at Examples/cmdLineBatchJob.*
Banate CAD is written in Lua, you also require Lua for Windows to run Lua scripts in Windows.
Step 9: Icosahedron
BanateCAD originally using BiParametric modelling method. It divide the sphere with the latitude and longitude and then divide each grid cell into 2 triangle faces. This method is simple and straight forward, but the problem is the face density near 2 poles is much more than the place around the equator. It introduce 2 problems:
- inefficient of modelling, the pole area no need that much faces to modelling but ate a big portion of your computer resources
- unbalanced details if you rotate and planar cut the model
So I have written a new modelling method in BanateCAD using refined Icosahedron. The middle model of the above 2 pictures is BiParametric and 2 side models are Icosahedron. As you can see Icosahedron model is more efficient for modelling spherical object.
Step 10: Refinement Level
Icosahedron is a 20 faces polyhedron. Only 20 faces surely not good enough to modelling a Moon. We can refine the detail by divide each face (triangle) into smaller parts, e.g. divide each side into 2 parts can divide a triangle into 4 triangles, we call it refinement level 2; divide each side into 3 parts can divide a triangle into 9 triangles, we call it refinement level 3.
The above picture from left to right illustrate refinement level 1, 2 and 3.
Step 11: How Much Refinement Level?
23K map data theoretically can can make refinement level up to 2304. It generate a 106168320 faces model and is a over 10 GB STL file in binary format. I don't think there are a software on normal desktop computer can handle this huge model. Then how much refinement level we should use?
Some FDM 3D printer claim their accuracy up to 50 microns. It is a very precise figure, but I think there are 2 bigger figures that affect the precision:
- layer height, most FDM 3D printer can print layer height at 0.1 mm. Not many printer can improve quality by reduce the layer height lesser than 0.1 mm. E.g. my printer print at 0.06 mm worser than 0.1 mm.
- Extruder size, most FDM 3D printer packaged a 0.4 mm extruder, some are 0.3 mm. 0.2 mm or smaller size are not popular.
0.1 mm layer height and 0.4 mm extruder is much bigger than 50 microns.
I would like to push the 3D printer limit so I assume a better printer can print at 0.05 mm layer height. It is not make sense 1 layer can represent a triangle face shape, I think it should be at least 3 layers can represent it. So I assume the refinement level should modelling each triangle face side length up to around 0.15 mm.
The above picture have 2 print sample, one of it's refinement level is double of the other one, can you see the different?
Step 12: Progressive Refinement Level Generation
I have generated the Moon lamp model from 1 inch to 8 inches. In order to have the triangle face side at around 0.15 mm for each size, I am using progressive refinement level:
- 1 inch at refinement level 96
- 1.25 inches at refinement level 120
- 1.5 inches at refinement level 144
- 1.75 inches at refinement level 168
- 2 inches at refinement level 192
- 2.5 inches at refinement level 240
- 3 inches at refinement level 288
- 3.5 inches at refinement level 336
- 4 inches at refinement level 384
- 5 inches at refinement level 480
- 6 inches at refinement level 576
- 7 inches at refinement level 672
- 8 inches at refinement level 768
You can find the generated STL at Thingiverse:
Refinement level 2304, the 23K image limit, can generate a 24 inches Moon lamp model but the output size is over 10GB :o
Thingiverse have a upload size limit so the refinement stopped at 360. You may find larger STL file at cgtrader:
Step 13: Material Light Transmittance & Color Variance
I print all my Moon lamp with white PLA filament. However, not all white PLA are the same on light transmittance and color variance.
The above picture show 1 plain PLA and 5 white PLA filament from different vendors. Which one is the best is very subjective, but lesser color variance should be better. Higher light transmittance require thicker shell but have better grayscale level; Lower light transmittance require thinner shell and can save much printing material and printing time. The Moon lamp printed in this instructables is using the bottom right one, no notable color variance and lowest light transmittance.
Note: if you have more than 1 type of white filament, you can make a similar test with the attached STL.
Step 14: Shadow Factor
The generation script I written in BanateCAD have some parameters that can adjust, e.g. height and shadow factor.
The shadow factor is very depends on the filament light transmittance attribute and also depends on what light source you use. Higher light transmittance require larger shadow factor value; brighter light source also require larger shadow factor value.
The above 2 pictures use same white PLA filament, the first one set shadow factor 6 and the second one set shadow factor 8. Larger shadow factor value make higher contrast level but at the same time you can see more filament color variance.
In most case use warm white light can overcome the filament color variance.
Step 15: Height Factor
Smaller Moon lamp require larger height factor to emphasise the surface details and lithophane effect; larger Moon lamp in contrast too much height factor make surface detail distracting the color map detail.
The above picture from left to right is height factor 0.05, height factor 0.0725 and diymoonlamp.
Step 16: Calibrate Your 3D Printer
3D Printer is not prefect out of the box, e.g. I found my 3D printer is around 5% under extrusion while calibration. There are many post teach you how to calibrate your 3D printer, e.g.:
Step 17: Rotation
The FDM 3D printer degrade print quality substantially while printing top and bottom most part of a sphere object. It is because the overhangs at that part is over 45 degree. Even you added print support, you can see notable layer mark if the top most part is a smooth surface.
In most case we want to see the Moon front face, the face we always seeing in the earth, it is the most important detail should print in highest quality. We should avoid this important detail rotated to top and bottom most part. But at the same time I would like to rotate a little bit to avoid the front face cut by the bottom lamp shade hole. So I recommend rotate Y axis 10 degree to keep a complete and high quality Moon front face.
If it is a hanging lamp, you will print it upside down. I recommend rotate Y axis 170 degree.
Step 18: Print Support
Print with support can have a better result, but it is time consuming and waste too much filament. Print without support introduce some tiny hole on the top, but it is not very notable if Moon front face are not here. If you have a 3D pen in hand you can fill the holes easily.
Step 19: Ornament Lighting
This Moon Lamp is very high detailed even 1.5 / 2 inches in size, it is very good make it as an ornament. E.g. Christmas ornament on the Christmas tree or a keyring you can bring every day. You only require a tiny LED to light it on.
I have prepared the STL from 1.5 to 3 inches that can fit the above tiny LED, you can find the STL at Thingiverse filename tailing with "_Y170_Ornament.stl".
Step 20: 3D Printing
Remember set infill 100% before print it out.
The Moon lamp model is an hollow object, setting infill 100% means print a solid shell only.
There are no other special option for printing the Moon lamp.
Step 21: Matte Surface Finishing
Most PLA printout have some sort of reflection, especially view from the top, it is easy to reduce the reflection by applying matte/flat spray paint.
Step 22: Look Like a Moon VS Sophisticated Detail
I have modelling 3 generation of Moon lamp model. Actually I think the 1st generation is most look like a Moon you can see in the sky. Very bright in darkness, some shadow details and a little blurry. You cannot see Moon details very clear because it is too bright in the night sky.
But when I hold it in hand, I can look closer and closer. I just think it is too blurry, I want much more details on it. So I made 2nd generation and then 3rd generation. I know it is still much more detail in source map not yet can print out. May be few years later the 3D print technology can make it...
Step 23: Enjoy!
It is time to show off what high quality your 3D printer can print and also share your love to other peoples!
Runner Up in the
Make it Glow Contest 2018