Unicorn G-Code Output Extension for Inkscape

Uninstall pstoedit and join all the cool kids who are generating Unicorn plots directly from Inkscape using the Unicorn G-Code Output Extension for Inkscape!



Inkscape is a free, Open Source vector art program. Inkscape can be extended by writing Python scripts, which makes it possible to add some very powerful functionality!

The Unicorn G-Code Output extension for Inkscape is an Inkscape extension that lets you save your drawings to .gcode files suitable for plotting on the Unicorn from ReplicatorG!



Inkscape doesn't provide a way of making one-click installers for extensions, but the process is pretty easy: download the files and put them in your Inkscape extensions directory.


You can download the latest version of the extension from GitHub:


If you have Git installed, you can get the whole repository:

git clone git://github.com/martymcguire/inkscape-unicorn.git

Otherwise, feel free to click the Downloads button on the project page to get a .zip or .tar.gz file.


If you downloaded a .zip or .tar.gz file, unpack them.

Copy Files

You'll find all of the files needed for the extension in the src/ directory of the package you downloaded. You'll need to copy the contents of this directory (unicorn.inx, unicorn.py and the unicorn/ directory) to your Inkscape extensions directory.

Depending on your operating system and where you have Inkscape installed, your extensions directory will be in a different place:

  • OS X - /Applications/Inkscape.app/Contents/Resources/extensions
  • Linux - /usr/share/inkscape/extensions
  • Windows - C:\Program Files\Inkscape\share\extensions

Verify Installation

Fire up Inkscape (or restart it if you had it open) and select File | Save a Copy. If the extension is installed properly, you should see the MakerBot Unicorn G-Code (*.gcode) option.


Basic Usage

Preparing Your Artwork

When saving your Unicorn G-Code there are a couple of limitations to be aware of:

  • All text objects must be converted to paths.
    • You can do this by selecting the text objects and choosing Path | Object to Path
  • Curves, such as ellipses and Bezier curves, will be converted to straight line segments. This should not affect your output very much, but is something to be aware of.

Save as G-Code

When you're ready to export your G-Code:

  1. Save your SVG file as normal
  2. Choose File | Save a Copy
  3. In the file selection dialog, choose MakerBot Unicorn G-Code (*.gcode) and choose a location to save your file.
  4. The Unicorn Output options dialog will appear. Check your options (see below for details) and click OK when you are done.


Setup Options


These are options to match your particular Unicorn hardware (for example, if you are using a non-standard servo) or calibration:

  • Pen Up/Down Angle
  • Delay after pen up/down commands to wait before moving. These give the pen a chance to get off of (or onto) the paper before moving again.
  • XY Feedrate determines the platform speed during a plot.
  • Z Feedrate determines the speed the Z-platform moves (if it needs to)
  • Z-axis height after printing moves the platform up after a plot. If you leave it at 0.0, it won't move at all.

Pen Registration

Note: This feature relies on ReplicatorG's ability to pause a build and prompt the user. It will not work when building from SD card.


Checking the box in this tab will add some extra commands to your G-Code to quickly lower and raise the pen at the start of a print (or the start of each page if doing multi-page printing).

After the registration test, the G-Code will pause and ask you to confirm that the registration test was successful. Pressing No will abort the plot.




By default, the Unicorn output extension assumes that you begin your plots with the pen hovering above the center of the build platform. This is position (0,0).

Depending on where you like to start your plots, and which axes you may or may not have reversed, you will want to change this value.

Finding a Good Homing Value

To find the Homing values you like:

  1. Start with the pen centered over the build platform.
  2. Open the Control Panel in ReplicatorG and click "Zero Axes".
  3. Use the X+/- and Y+/- buttons to move the platform to where you like.
  4. When you're satisfied, copy the X and Y location values displayed in the control panel to the Homing tab in the Inkscape extension.

Multiple Copy Automation

Note: This feature relies on ReplicatorG's ability to pause a build and prompt the user. It will not work when building from SD card.


This tab lets you plot your image multiple times, adding extra prompts during plotting to let you remove a print before beginning the next.

  • Number of copies lets you specify a fixed number of copies, after which the plotting will end.
  • Plot continuously? - if checked, this will not insert multiple copies into your G-Code file, but will instead add an M30 code to the end of the file, causing ReplicatorG to restart the print from the beginning.

Pen Changing for Multiple Color Plots


If checked, this option allows you to create multi-color plots.

Preparing Your Artwork

You'll want to group all objects of the same color into groups, preferably naming the group after the color.


When this option is enabled, ReplicatorG will pause at the beginning of each layer and present a prompt indicating which layer it is about to plot. This gives you the chance to change pens or make other adjustments before dismissing the dialog and continuing the plot.

Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.