flickr:4886592316 is a script derived from (used for the frostruder) that will take a DXF and convert it into a printable .gcode file for your Unicorn MK1. It has some optional configurations to set speed, line widths, etc.

See the Unicorn MK1 usage page for information on where to download and some of the other tools/scripts.

Step 1: Create your DXF File

There are many programs that generate DXF files, but we recommend using QCAD.

It's also fun to generate DXF files from images. Let's say you wanted to have your MakerBot draw your portrait…

First, find a nice image of yourself. Side profiles with a good amount of contrast often turn out well. Open it in your favorite image editor. I used GIMP.
Prepare the image to be traced (vectorized). I like to adjust contrast, threshold, and then scale (300px wide has worked well).
Now you'll have to generate the vector paths from the image. There are a couple of ways to do this. You can open the image in Inkscape and use it's "Trace Bitmap" option to vectorize your image or you can try an online vectorizer like I've gotten good results from both.
flickr:4878819251 will give you a .dxf that you can open directly in QCAD. If you use Inkscape you'll have to move the vector trace off of the original image and delete the image. You can then save it as a dxf.
flickr:4879428416 flickr:4879428458
Open the .dxf in QCAD. You'll probably have to scale and position it (remember 1 unit = 1mm). I like to place the lower left corner of the trace on the origin so that everything is in the first quadrant. You should then start with your pen in the lower left corner of your build platform as well.
Now all you need to do is run the dxf through a python script to generate the g-code. See Step 2 for details.

Step 1.5: Some Helpful Hints

If you make your drawings centered on (0,0), make sure you center the extruder head on (0,0). If you make your drawings in the positive quadrant, make sure you position the extruder head in the lower left hand quadrant. As a sanity check, always open the DXF in a program like QCAD before printing.

When you are designing your file, keep in mind that the printer will attempt to print out exactly what you have drawn. Furthermore, we will interpret all units as millimeters, and will use the actual coordinates you use.

Note that we have not implemented ellipses, blocks, text, and a few other advanced/obscure features. To be safe, make sure you have converted all your files to simple lines and curves (in qcad, select all and type 'xp' for explode.)

Step 2: Create your GCode

Creating your GCode is pretty easy. First, you'll want to open the Terminal. This is found in the Utilities folder on mac or by typing "cmd" in "Run" on windows.
Navigate to the folder where you have (which is probably called "Scribbles Scripts") both in the finder/explorer and the terminal. This is best accomplished by typing "cd " and then dragging the folder into the terminal window. Then, press enter.
flickr:5006208740 5005596375_ceb3a8c6b1_o.png
Next, in the terminal you'll run the python script on your dxf file. Make sure you've copied your dxf file into the same folder as above (Scribbles Scripts) then enter:

 python unicorn-logo.dxf > unicorn-logo.gcode

If you want to get fancy you can specify your feedrate and a few other optional parameters. Here are a few examples:
#get a list of options and help
python --help
#generate gcode with standard settings
python test.dxf > test.gcode
#generate gcode with a feedrate
python --xy-feedrate=1234 test.dxf > test.gcode
#generate gcode with a bunch of settings
python --xy-feedrate=1000 --start-delay=50 --stop-delay=100 test.dxf > test.gcode

A gcode file should magically pop into existence.

Step 3: Run your GCode

  1. Startup ReplicatorG (0019 or later)
  2. Open your newly created GCode
  3. Position your pen's tip about 1mm or so above your paper and in the proper xy position (typically the lower left hand corner if your drawing is located in the first quadrant)
  4. Hit build and gaze upon the mysterious Unicorn MK1 as it spring to life to create your vision

Further Exploration: Want to impress your friends? Try having the Unicorn draw you a maze.

  1. There are lots of awesome maze generators online but my favorite is John Lauro's Maze Maker. Mazes with thin walls relative to the paths come out the best (I like to specify 1 pixel walls and 10 pixel paths in Maze Maker).
  2. Use or Inkscape to turn your maze image into a dxf. In you'll want to set the line offset to 10 and noise reduction to 1.
  3. Check the dxf in QCAD and send it through
    1. (hint: use a feedrate of 2000 or more to seriously impress your friends with its drawing speed or 1500 or less to prove it's accuracy)
Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.