Thankful for our first 50 makers. Founding membership: $149 once, every app, for good.

Claim your place
GCarve

GCarve › User manual

Post-processors in GCarve

How to change a built-in post for your machine, or write your own.

A post-processor turns GCarve's toolpaths into the G-code dialect your controller reads. GCarve comes with built-in posts for GRBL, Mach3/4, LinuxCNC, UCCNC, Centroid, Masso, WinCNC, ShopBot, Haas and others. You can also add your own: a GCarve .json post, or a Vectric .pp post you already have.

Change a built-in post

  1. Open Toolpaths › Post-Processors….
  2. Find the built-in post closest to your controller. Search by machine, controller, units or file extension, for example Shapeoko, Mach4, mm or .sbp.
  3. Click the export icon on its row, Export as editable JSON. GCarve saves a .json file.
  4. Open the file in any text editor (Notepad, TextEdit in plain-text mode, VS Code). Give it a new "name" so you can tell it apart, then change what you need (see below).
  5. Back in Post-Processors, click Upload post… and pick your file. It's added as a custom post, and the built-in post is left as it was. The new post is selected for the current board straight away.
  6. Export a job, then run File › Export Air-Cut Test… (the same file raised well above the board) before cutting wood.

To change it again, edit the file and upload it once more: a post with the same "id" replaces the old one. A custom post can be deleted with the bin icon on its row.

Already have a Vectric .pp post for your machine? Upload it as it is: GCarve translates it. Air-cut the first file to make sure it reads the same way.

What's in a post file

Here's the built-in GRBL (inch) post as it exports. A key you leave out keeps its default, and unknown keys are ignored.

{
  "id": "grbl-in",
  "name": "GRBL (inch, .nc)",
  "controller": "GRBL",
  "machines": "Shapeoko, X-Carve, …",
  "extension": "nc",
  "inches": true,
  "decimals": 4,
  "arcs": true,
  "maxArcSweepDeg": 180.0,
  "comment": "({})",
  "header": "({FILENAME})\n(Tool: {TOOLNAME})\nG90 G20 G17 G94\nG54\nM3 S{RPM}\nG4 P2\n",
  "toolChange": "",
  "pathStart": "({PATHNAME})\n",
  "pathEnd": "",
  "footer": "M5\nG0 Z{SAFEZ}\nM30\n",
  "rapid": "G0 {X} {Y} {Z}",
  "linear": "G1 {X} {Y} {Z} {F}",
  "arcCW": "G2 {X} {Y} {Z} {I} {J} {F}",
  "arcCCW": "G3 {X} {Y} {Z} {I} {J} {F}",
  "feedChange": "",
  "plunge": "",
  "retract": "",
  "firstLinear": "",
  "substitute": "",
  "feedDecimals": 0,
  "lineNumberStart": 10,
  "lineNumberStep": 10,
  "modalAxes": true,
  "crlf": false
}

In the text blocks, \n starts a new line.

About the post

KeyWhat it does
idIts own short name. GCarve adds user- in front, and if it's the same as a built-in's, uses the file name instead.
nameWhat the list shows.
controller, machinesWords for the search box.
extensionFile extension of the G-code, without the dot: nc, tap, gcode…
inchestrue = numbers in inches, false = millimetres. Use the matching G20 / G21 in your header.
decimalsDigits after the point for coordinates.
feedDecimalsDigits after the point for feed rates.
crlftrue = Windows line endings, which some controllers need.

Measurements you can set

These keys are optional: leave them out and the values come from the job. Numbers are in the post's units (inches or mm).

KeySets
safeZ{SAFEZ}, instead of Job Setup's lift height. E.g. "safeZ": 25 in a mm post.
homeX, homeY, homeZ{XH}, {YH}, {ZH}: where the post sends the machine at the end, e.g. "footer": "M5\nG0 Z{ZH}\nG0 X{XH} Y{YH}\nM30\n".

Every other number in a post is plain text in its blocks (dwell times, G53 Z0 lifts…), so change it there.

Blocks: where text goes in the file

KeyWritten
headerOnce, at the top of each file.
toolChangeBefore each bit. Empty = one file per bit (manual tool changes). Filled = one file with every bit, for tool changers: this block is written before each bit, with that bit's {TOOLNUM}, {TOOLNAME} and {RPM}.
pathStartBefore each toolpath (profile, pocket…).
pathEndAfter each toolpath.
footerOnce, at the end of each file.
commentHow a comment looks: {} is the text. ({}) for most controllers, [{}] for WinCNC, ;{} for others. Empty = no comments.

Moves

KeyUsed for
rapidFast moves in the air.
linearStraight cutting moves.
arcCW, arcCCWClockwise and counter-clockwise arcs.
arcsfalse = no G2 / G3: arcs are written as short straight moves.
maxArcSweepDegLonger arcs are split into pieces of at most this many degrees.
plungeStraight-down cutting moves. Empty = linear.
retractStraight-up rapid moves. Empty = rapid.
firstLinearThe first cutting move after a rapid. Empty = linear.
feedChangeA line of its own whenever the feed changes, for controllers like WinCNC (F{f}). When it's set, {F} is left out of the moves.
modalAxestrue = an axis that didn't change is left out of the line.
substitutePairs of characters swapped in names, e.g. ({)} turns ( into { and ) into }, so a toolpath name can't end a comment early.

Placeholders

In the move lines

PlaceholderGives
{X} {Y} {Z}Letter and number, e.g. X1.2500, written only when there is a value (and, with modalAxes, only when it changed).
{I} {J}Arc centre, relative to the start, e.g. I0.5000.
{F}Feed rate with its letter, written only when the feed changes.
{x} {y} {z} {i} {j} {f}The bare number, every time. For dialects like ShopBot: M3,{x},{y},{z}.

Anywhere

PlaceholderGives
{RPM}Spindle speed of the bit.
{TOOLNUM}Bit number (its slot in the Tool Library, or 1, 2, 3… in cutting order).
{TOOLNAME}Bit name.
{PATHNAME}Toolpath name (in pathStart / pathEnd).
{FEEDXY}, {FEEDZ}The toolpath's cutting and plunge feeds.
{SAFEZ}The lift height for moves from Job Setup (Lift for moves), measured from Z zero.
{XH} {YH} {ZH}Home position: the post's own homeX / homeY if it sets them, else Job Setup's "Park the bit at X / Y", else 0, 0. {ZH} is the lift height unless the post sets homeZ.
{XLENGTH} {YLENGTH} {ZLENGTH}Board width, height and thickness from Job Setup.
{XMIN} {XMAX} {YMIN} {YMAX} {ZMIN} {ZMAX}The toolpath's extents.
{UNITS}inches or mm.
{ZZERO}Material Surface or Table: where Z zero is.
{FILENAME}, {MATERIAL}, {DATE}, {TIME}File name, board material, date and time of export.
{N}Line number, counting from lineNumberStart by lineNumberStep: put N{N} at the start of a line.

Safety: what GCarve always adds

Example: GRBL with a tool changer

Start from the GRBL post, then set a toolChange block and take the spindle start out of the header, so every bit goes into one file:

"name": "My GRBL ATC",
"header": "({FILENAME})\nG90 G20 G17 G94\nG54\n",
"toolChange": "(Tool: {TOOLNAME})\nM5\nG53 G0 Z0\nT{TOOLNUM} M6\nM3 S{RPM}\nG4 P2\n",

Save, upload, export, then air-cut it before the first real cut.

Try it on your own job: GCarve is free, runs in your browser with a free account, and has free desktop apps.

Open GCarve free