G-code to Lines: convert a G-code toolpath into a polyline

Turn a G-code program into a lines object you can measure, edit and convert like any other polyline

1 min read
In the app
  • ToolpathG-code to Lines

G-code to Lines (Toolpath › G-code to Lines) turns a G-code object into a lines object: one polyline per move of the program. Use it when you need the toolpath as ordinary geometry, for example to measure its length, offset it or build a mesh or a tube from it.

Convert a Program to Lines

  1. Open a G-code program (.gcode, .nc or .txt) with Open Files, or build one with Toolpath.
  2. Select exactly one G-code object and click Toolpath › G-code to Lines.
  3. Choose whether to keep the idle moves: turn on Save Idle Movement to include them. Idle moves are the rapid G00 moves, when the tool travels without cutting. The option is off by default, so the result holds only the cutting moves.
  4. Click Convert.

G-code to Lines panel with Save Idle Movement and Convert next to the wolf.nc contour program; the short diagonal line at the lower left corner is the rapid G00 move to the start point

The tool replaces the G-code object with a lines object of the same name; objects that were under the G-code object move under the new lines object. A closed move (one that ends where it starts) becomes a closed polyline. To get the G-code object back, use Undo.

Result of G-code to Lines: the wolf contour is now a lines object named wolf, drawn as white polylines; the rapid move at the start is gone because Save Idle Movement was off

What You Can Do With the Lines

The result works with every tool of the Lines tab. Select it, and the Information panel shows the total Length of the path and its number of Components; to inspect single vertices and edges, use Lines Info. To turn the path into a mesh, a tube or an extrusion, see Lines & Distance Maps Basics.

Once converted, the path is no longer a program: the G-code Visualizer and the milling simulation need the G-code object. Run them before you convert, or open the file again.

Customize Consent Preferences

We use cookies and similar technologies, such as local storage. You will find detailed information about all of them under each consent category below.

To learn more about how Google processes personal information, visit: Google privacy policy

Always Active