How to Convert DXF to G-code for CNC Hot Wire Foam Cutting

Almost every foam part starts life as a DXF file: a sign drawn in Inkscape, a cornice profile from AutoCAD, a wing rib from an airfoil database. A CNC hot wire foam cutter can't read a DXF directly. It needs G-code, the list of moves and feed rates that drives the motors. This guide shows how to convert DXF to G-code for hot wire cutting, and the details that make the difference between a clean part and a ruined block.

Why hot wire needs its own DXF to G-code workflow

Most free DXF to G-code converters are written for routers, lasers and plasma cutters. Those tools can lift off the material, jump to the next shape and plunge again. A hot wire can't. The wire is stretched across the whole block, so:

  • Every cut is one continuous path. The wire enters from the edge of the block, follows the outline and leaves the same way.
  • Inside holes need an entry slot. To reach a hole, the wire has to cut its way in, usually with a thin vertical entry that closes up later.
  • The wire melts a kerf. The hot wire removes a channel of foam, so the path has to be offset to keep the part to size.
  • 4-axis machines move two ends separately. For tapers and wing cores, the left and right profiles must be converted together so both towers stay in step.

That's why foam-specific CAM software, rather than a generic converter, is the usual way to get from DXF to G-code for hot wire cutting.

Step 1: Prepare a clean DXF

Most failed conversions come from a messy drawing, not from the converter. Before exporting, check that:

  1. The outline is one closed polyline. Join lines and arcs so there are no tiny gaps between segments.
  2. There are no duplicate lines. Overlapping segments make the wire trace the same edge twice.
  3. Splines are converted to polylines or arcs if your converter doesn't read splines well.
  4. Units are millimetres and the drawing is at full size (1:1).
  5. Text is converted to outlines. Letters must be geometry, not a font reference.
  6. Extra layers are removed: dimensions, centre lines and title blocks have no place in a cut file.

Tip: In ChandramaCAD, the Join Segments tool and the Cut Path Validator handle the first two checks for you, and Photo Trace turns a logo or sketch straight into a clean vector outline (see how to convert an image to DXF).

Step 2: Plan the wire path

Decide where the wire enters the block and which way it travels around the shape:

  • Lead-in and lead-out: a short straight move from the block edge to the start point, ideally on a corner or flat edge where any mark won't show.
  • Direction: keep the same direction for similar parts so kerf and drag behave the same way. ChandramaCAD's Reverse Path flips it if needed.
  • Holes: add a thin vertical entry from the outer edge into each hole.
  • Several parts on one block: nest them to save foam, then link them into one path so the wire never has to leave the foam.

Step 3: Set kerf and feed rate

The kerf depends on wire diameter, temperature, foam density and speed. Cut a test square, measure it, and use half the difference as your offset. Then set the feed rate for the foam: as a starting point, roughly 200–400 mm/min for standard EPS and slower for dense XPS. Our feed rate guide explains how to tune it.

Step 4: Convert the DXF to G-code

Load the DXF into your CAM software and generate the program. A typical 2-axis hot wire program looks like this:

G21           ; millimetres
G90           ; absolute coordinates
M3            ; wire heat on
G1 X10 Y0 F300   ; lead-in from block edge
G1 X110 Y0       ; follow the outline...
G1 X110 Y60
G1 X10 Y60
G1 X10 Y0
G1 X0 Y0         ; lead-out
M5            ; wire heat off

On a 4-axis machine, each line also carries the second tower's position, commonly as U and V (some controllers use Z and A). Both profiles need the same number of points, matched up in order, so the wire stays straight between matching points on each side. That is what makes tapered parts and RC wing cores possible.

Step 5: Preview before you cut

Always look at the toolpath before heating the wire. Check the start point, the direction, that the size matches the drawing, and that nothing runs outside the machine's travel or the block. A preview costs seconds; a ruined block of XPS costs real money.

Doing it with ChandramaCAD and ChandramaGCODE

We built two Windows apps for exactly this workflow:

  • ChandramaCAD to draw, trace or import the shape (DXF, SVG, airfoil DAT, STL/STEP), with hot-wire tools such as kerf compensation, vertical entry for holes, nesting, and a wing profile generator for tapered 4-axis cuts.
  • ChandramaGCODE to load the DXF from ChandramaCAD or any CAD tool, preview the toolpath, and export optimised G-code in one click.

Each is a one-time purchase of $49, with no subscription. Weighing them against free tools? See free CAD and G-code tools for foam cutting.

Convert your next DXF in minutes

ChandramaGCODE loads DXF files from any CAD tool and exports G-code for 4-axis hot wire foam cutting.

See the software →

Frequently Asked Questions

Can I convert DXF to G-code for free?

Yes, there are free general-purpose DXF to G-code converters, but most are made for routers, lasers and plasma cutters. They don't handle hot wire needs such as one continuous path, kerf compensation and synchronised 4-axis profiles. Foam-specific CAM software such as ChandramaGCODE saves that manual work.

Why does my DXF give a broken or jumping toolpath?

The usual causes are gaps between segments, duplicate overlapping lines, splines the converter can't read, or a drawing in the wrong units. Join the segments into one closed polyline, delete duplicates, convert splines to polylines and save the DXF in millimetres.

What is the difference between 2-axis and 4-axis G-code for hot wire cutting?

2-axis G-code moves both ends of the wire together with X and Y. 4-axis G-code moves each tower separately, commonly X/Y for one side and U/V (or Z/A) for the other, so the two ends can follow different profiles for tapered parts and wing cores.