modified heightmap script

The original script can be found at: http://www.timeguy.com/cradek/image-to-gcode
It is released under the GPL.

The script were modified to support mutiple rough runs and a final fine run. The other feature I added is omitting empty lines and add a seperate feedrate in safetyheight. The step size and other needed variables can be edited in the source file. If you want to use the toolchange you need to save your heightmap in two resolutions, corresponding your step-setting in the image-to-gcode.py. Also you need to compensate the cutter radius, this can be done with the generic Gimp filters.

What a heightmap can look like:

skullLeft
Rendered heightmap with visible polygons
skullSmooth
Smoothed heightmap. Polygons are less prominent

This skulls origin is a GPLd blender model. It is based on medical data.

Sourcemodel.

Read the story of the skull being milled.

More blender models.

Screenshot of the sourcemodel in blender:

Blender setup for rendering of heightmaps
Blender setup for rendering of heightmaps

And the front of the same model in styrofoam:

Milled skull with my diy recycled-printer-mill
Milled skull with my diy recycled-printer-mill

 

3D Mesh-to-Heightmap Generator – Tool for converting a 3D file to a heightmap.

Download: img2gcode_modified.tar.bz2

The output is loadable with emc2

bitmap2vector

Looked at from near it looks like stripes and looked at from far it looks like a picture. Applied on a window, it enables you to look through from near and look at a picture from far.

The last converter was written in C, but I like Python more and more. No filepointer is necessary, the debugging info is useful and handling of variables is easy. The svg core is taken from the net. The license is not defined by the author and on the same site I found following sentence: “Except where otherwise noted, recipes in the Python Cookbook are ¬†published under the Python license.“. Looks free to me. I changed the integer output to float and added functions for polygons of any pointcount.

The other part is taken from the Timeguy again. His script is intended to generate g-code and looks at the brightness of every pixel. The same is needed here, except the g-code part. Because it is for vinyl plotter, I added a maximum and a minimum bound, this makes later deburring easier and the stripes more stable.

The new spiralscript has a positioning bug in the center. You can play with the initial circlesize (variablename: circle) to compensate this.

This picture drawn by Leonardo da Vinci now sticks to my door

You can discern the stripes in the detailed view. This is the first try. The next one will be made with a border, because the narrow stripes will turn up at the ends, also the min- and max-bound wasn’t implemented when this got cut.

Grotesque_Profile
source image

The licensing is more complicated this time. The included “svg.py” is Python licenced and the other parts are GPLd.

Download:
bitmap2vector_30jan2008.tar.bz2
bitmap2vector_30jan2008.zip

There are four scripts, one for waves like the one decorating my door, one for circles, one for squares and one for spirals.

bitmap2vector_old.tar.bz2

vectorwave
detailed view of the output

 

Circletux Wavetux Squaretux Spiraltux
I have the idea of transforming the result so it looks straight on sloped surfaces like the rearwindow of a car. But Im lacking some mathematics to get this done and I get instantly tired while reading math books. Maybe ill add it later.