Drawing with Gcode
It took me a lot of time, web searches, trials and errors to find a way to convert a bitmap image into a nice Gcode tool path.
I have tried many things including extruding a greyscale image into a 3D mesh and then extract its first slice using Axon/Skeinforge.
But this method, like many others, produced very poor results...
...until I found out there is a pen-plotter project for the Makerbot called "Unicorn".
I have allready successfully used a Makerbot script in the past after some code tweaking (see the "lampshade" script). The Makerbot Gcode is very similar to the BfB Gcode so I decided to give the different Unicorn scripts a try. Among all the available methods and scripts I've tried, I think that this Inkscape method is the one that best fits my needs.
But what does "drawing with Gcode" really means ?
The process of drawing is to lay down successive pen strokes on a paper. These strokes will be done by giving your pen some path orders (or tool paths). And in between strokes, the pen will have to be lifted from the paper (traveling without drawing). To graphically produce those paths, we will need to vectorize our bitmap, where the vectors will become our outputed Gcode tool paths. So a bitmap image can't be directly pen plotted. It needs to be vectorized first, and that's what Inkscape is good at.
- import your bitmap
- vectorize it (Path/Trace bitmap) using the method that best fits your taste
- export it as a .gcode file (File/Save a copy/Makerbot Unicorn Gcode)
Try it out and check the resulting Gcode file. Now have a look at the different python script files (they should be in the Inkscape directory) and modify them in order to output BfB specific Gcode lines instead of Makerbot ones. Try again, check the outputed Gcode and modify the scripts until you are satisfied with the result. When the outputed Gcode will be exactly what you expect you are ready to do your first drawing with a Rapman.
the "Unicorn" tool head includes a stepper motor to lift up the pen. As my (very simple) tool head does not, I must replace "pen lifting" by "bed lowering" instructions. My tool will only do XY plane moves (pen strokes) while the bed will do Z axis moves (paper up and down). So the Unicorn python script has been modified accordingly.
And what about color drawing ?
Activate the "Pause on layer changes?" button on the "Pen Changes" tab. As it says, this will introduce a Gcode pause at each layer change (M226 for the Rapman). The plugin outputs the Gcode so that each layer is drawn one by one in the order of the stack (bottom layer being printed first). So if you create as many layers as the number of pen/colors you intend to use, and place all paths that should be the same color on the apropriate layer, you will be able to do a pen/color change before the next layer is performed, then press the "Esc" button to start drawing again.
Why not an option for extruding ?
I also added a new tab allowing for "extruder" specific output Gcode. I can now print using a pen ("Plotter Setup" tab) or the regular BfB extruder ("Extruder Setup" tab).
I haven't modified the "Registration" and "Copies" tabs.
I don't know exacly what they're doing and I'm not using them at all.
Have a nice plotting time !