Bas relief is needed to CNC carve most 3D scenes, as the available (Z) depth of the CNC process is much less than the depth used in most 3D models. Coins are a good example of bas relief images.
A simple, ie proportional, scaling does not work well; most of the detail is lost.
Instead, a non-linear projection should be used. Typically these projections emphasize changes-in-depth, rather than absolute depth. Emphasizing this part of the depth data appears to trick, or allow, the human brain to infer the original depth information, making bas reliefs look more recognizable and “realistic”.
There are commercial programs that will do these projections, for example ArtCam and Vectric Aspire. They are costly.
BlenderCAM, free, has the ability to generate bas reliefs. The process is not straight forward.
There are several research papers and a few scripts out there as well.
In most cases the process steps are:
Generate a depth map of the 3D scene. This is usually a grey-scale image where the shade of grey represents the depth or height. They are also called height maps, and Z buffers. Blender can be used to generate these.
Apply a non-linear scaling to the image. “Height map” aware algorithms look at the 2 dimensional first and second order differentials- the 3D slope, and rate of change in slope, and adjust the heights based on this information. People have also had success with applying typical 2D image adjustments, such as gamma correction (so-so results) and unsharp mask (better) to the height map data.
Use the adjusted height map to generate a CNC routing path. Vectric VCarve and CamBam can do this. Tests need to be done; I suspect both packages will generate “scanning” paths (across X, move down Y, continuously vary Z), which may not be good paths for milling. There may be a need to convert the adjusted height map back into a 3D model (STL) so that the CNC tools will generate smart milling paths- eg use adaptive clearing.
This projects goals are:
- document how to create and save a height map (Z-buffer image) from blender
- create/adjust/find software that will do the non proportional height scaling
- document how to covert the adjusted height map into “safe” milling G-Code
- Feature Sensitive Bas Relief Generation - paper. Has references to other approaches. Describes one algorithm and it’s results
- Bas-Relief Generation Using Adaptive Histogram Equalisation - one of the papers referenced by the above paper
- 2012: Computer Assisted Relief Generation—A Survey
- Jens Kerber has several publications on the area. Some of them can be downloaded from their web server
- BlenderCAM bas-relief code. Appears to implement some sort of gradient analysis (by blindly looking at the few comments in the code.) Might work with regular blender. Need to find documentation on how to use it, and try adding it to regular blender. Or use the (old) BlenderCAM blender package. Just noticed there are a lot of updates (after several years) to support the upcoming Blender 2.8. This may be an up-to-date solution!