Back to Blog

DXF to G-code: The Complete Hot-Wire Foam Cutting Workflow

·FoamCut Team
workflowDXFG-codetutorial

DXF to G-code: The Complete Workflow

Getting from a design file to a finished foam part involves several steps. This guide walks through the entire DXF-to-G-code workflow, from receiving a customer's file to running production cuts.

Step 1: Prepare Your DXF File

DXF (Drawing Exchange Format) is the standard file format for CNC work. Most CAD software can export DXF, including AutoCAD, FreeCAD, Inkscape (via extensions), and SolidWorks.

Key things to check in your DXF:

  • Closed contours: Every shape must be a closed path. Open lines will be ignored by most CAM software.
  • Units: Know whether your file uses millimeters or inches.
  • Scale: Verify the dimensions match your intended part size.
  • Layer organization: Group related shapes on the same layer for easier management.

Step 2: Import into CAM Software

Open FoamCut and import your DXF file. The software will automatically detect closed contours and display them on the canvas.

After import, verify that all shapes appear correctly and at the right scale. If shapes are missing, check for open paths in your original CAD file.

Step 3: Configure Cutting Parameters

Before generating the cutting path, set your machine parameters:

  • Kerf width: The amount of material removed by the hot wire (typically 0.5–2mm)
  • Feed rate: How fast the wire moves through the foam (mm/min or in/min)
  • Units: Match your machine's coordinate system (mm or inches)

Step 4: Optimize the Cutting Path

Path optimization determines the order in which contours are cut and where the wire enters each shape. Good optimization:

  • Minimizes travel time between cuts (less time with the wire moving without cutting)
  • Reduces material waste by choosing efficient entry points
  • Cuts holes before outlines so parts remain held in place during cutting

FoamCut uses a TSP (Traveling Salesman Problem) algorithm to find the most efficient cutting order automatically.

Step 5: Preview and Verify

Always preview your cutting path before exporting. Look for:

  • Correct cutting direction (clockwise vs. counterclockwise affects kerf side)
  • Logical cutting order (holes before outlines)
  • Entry/exit points that don't interfere with the finished part
  • Lead-in/lead-out arcs that avoid sharp corners

Step 6: Export G-code

Export the optimized path as G-code. The exported file will contain:

  • G0 commands for rapid moves (wire off, moving between shapes)
  • G1 commands for cutting moves (wire on, controlled feed rate)
  • Machine setup commands (units, coordinate system, feed rate)

Step 7: Run the Cut

Load the G-code into your CNC controller, set your work origin, heat the wire, and start the cut. For production runs, save your FoamCut project file so you can regenerate G-code instantly for repeat orders.

Tips for Better Results

  • Test on scrap first: Always run a test cut to verify settings
  • Measure and adjust kerf: The theoretical kerf value may differ from actual—measure your first part and adjust
  • Save machine profiles: Store your settings for different foam types and wire temperatures
  • Use holding tabs: For small parts, add tabs to prevent pieces from falling during cutting