<p>There are a number of programs available which will convert g-code to DXF, a common drawing format. If your device does not support DXF directly, there are a number of programs to convert DXF to SVG. I would paste links but a quick search with your favorite search engine should give you useful results. The better conversion programs will allow you to eliminate movement g-code entries, which prevents connections between lines. I did not paste links, as my research shows such variety as to be overwhelming. </p>

CC BY-SA 3.0
2016-03-22T15:12:02.853Z
The conversion itself should be fairly easy using such tools, but most such tools will convert each gcode movement to a separate vector. So, for example, if your drawing was a circle you'd get an awful lot of tiny strokes, instead of a single SVG, DXF, or similar "circle" object. Some devices do have gcode "arc" commands, but they might or might be used in your files. That should work fine, so long as you don't need to edit or change anything....
TextGeek
CC BY-SA 3.0
2016-03-22T23:18:58.347Z
I have run into that which you describe. It can make the result unpalatable, to be sure. I believe that the free program Inkscape, which reads vector files, has the ability to smooth such tiny strokes, but that turns a semi-automatic process into a much more manual one.
fred_dot_u
CC BY-SA 3.0
2016-04-01T15:45:43.707Z
I've found a possible solution, but don't have a file suitable to test. The web site https://makeprintable.com/ will accept g-code files (extension .gcode) and convert to an STL file. In the test I attempted, the gcode was for an outline of a rectangular block and the stl created was vertical. I used Meshmixer (free) to rotate it to the horizontal, then used Slic3r (free) to slice to SVG. When opened in Inkscape (free) it appeared damaged, but the paths were there when clicked. When opened in Illustrator, same result. The paths exist and need to be colored?
fred_dot_u
CC BY-SA 3.0
2016-03-21T10:26:04.343Z
2016-03-21T10:26:04.343Z
fred_dot_u
<p>This question is a bit of an edge case for what 3D Printing SE covers, but it has to do with topics most closely related to 3D printing.</p>

<hr>

<p>I've found a plethora of ways to convert SVG (vector graphics) into G-code, but I can't seem to find any way to take a series of G-code movements and convert them into lines as a vector graphic.</p>

<p>Why would I want to do this, you ask?</p>

<p>I have a Silhouette, which can cut paper, or draw on paper, depending on if you insert a knife tool or a pen tool.</p>

<p>I have a polar draw bot (Makelangelo) which doesn't want to behave... the motors keep losing steps when the number of steps/second is low, and thus positioning gets off.</p>

<p>I want to use the drawing algorithms in the Makelangelo software to create drawings using my Silhouette, but the Silhouette wants vector graphics, not G-code.</p>

<p>The simplest way in my mind to do this is to convert G-code generated in the Makelangelo software, convert it to a standard vector format (SVG), and import it into Silhouette's software suite.</p>

<p>Alternately, if there's a way to send G-code directly to my Silhouette and have it work, that'd be a much better solution.</p>

CC BY-SA 3.0
2016-03-21T05:05:16.607Z
I've converted gcode into an XYZ format before. With a couple Regular Expressions, you can reverse engineer a gcode file relatively back into 3D model. Is this kind of what you're looking for?
tbm0115
CC BY-SA 3.0
2016-03-21T05:48:15.710Z
Sort of. I am dealing with x, y, and "z", where z is lifting/lowering the pen. So 2D.
Marsh
<g-code><file-formats>
Convert G-code to SVG
Marsh
# Convert G-code to SVG

(Asked by: username_0 on 2016-03-21)

This question is a bit of an edge case for what 3D Printing SE covers, but it has to do with topics most closely related to 3D printing.

---

I've found a plethora of ways to convert SVG (vector graphics) into G-code, but I can't seem to find any way to take a series of G-code movements and convert them into lines as a vector graphic.

Why would I want to do this, you ask?

I have a Silhouette, which can cut paper, or draw on paper, depending on if you insert a knife tool or a pen tool.

I have a polar draw bot (Makelangelo) which doesn't want to behave... the motors keep losing steps when the number of steps/second is low, and thus positioning gets off.

I want to use the drawing algorithms in the Makelangelo software to create drawings using my Silhouette, but the Silhouette wants vector graphics, not G-code.

The simplest way in my mind to do this is to convert G-code generated in the Makelangelo software, convert it to a standard vector format (SVG), and import it into Silhouette's software suite.

Alternately, if there's a way to send G-code directly to my Silhouette and have it work, that'd be a much better solution.

**Tags:** g-code, file-formats

> **Comments:**
> **username_1**: I've converted gcode into an XYZ format before. With a couple Regular Expressions, you can reverse engineer a gcode file relatively back into 3D model. Is this kind of what you're looking for?  
> **username_0**: Sort of. I am dealing with x, y, and "z", where z is lifting/lowering the pen. So 2D.  

---

## 1 answers

### Answer by username_2 on 2016-03-21. Score: 3 | Accepted answer

There are a number of programs available which will convert g-code to DXF, a common drawing format. If your device does not support DXF directly, there are a number of programs to convert DXF to SVG. I would paste links but a quick search with your favorite search engine should give you useful results. The better conversion programs will allow you to eliminate movement g-code entries, which prevents connections between lines. I did not paste links, as my research shows such variety as to be overwhelming.

> **Comments:**
> **username_3**: The conversion itself should be fairly easy using such tools, but most such tools will convert each gcode movement to a separate vector. So, for example, if your drawing was a circle you'd get an awful lot of tiny strokes, instead of a single SVG, DXF, or similar "circle" object. Some devices do have gcode "arc" commands, but they might or might be used in your files. That should work fine, so long as you don't need to edit or change anything....  
> **username_2**: I have run into that which you describe. It can make the result unpalatable, to be sure. I believe that the free program Inkscape, which reads vector files, has the ability to smooth such tiny strokes, but that turns a semi-automatic process into a much more manual one.  
> **username_2**: I've found a possible solution, but don't have a file suitable to test. The web site https://makeprintable.com/ will accept g-code files (extension .gcode) and convert to an STL file. In the test I attempted, the gcode was for an outline of a rectangular block and the stl created was vertical. I used Meshmixer (free) to rotate it to the horizontal, then used Slic3r (free) to slice to SVG. When opened in Inkscape (free) it appeared damaged, but the paths were there when clicked. When opened in Illustrator, same result. The paths exist and need to be colored?  

---

