GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

2D to CAM workflow

How to Convert 2D File for CNC Machine

This guide is for engineers and designers who need to convert 2D file for CNC machine work without scrapping parts. It covers geometry cleanup, unit checks, contour closure, and the export settings we verify every day in our own shop.

DXF-first workflowUnit and scale checkClosed contours only
Convert 2D file for CNC machine work on custom auto spare parts
Quick answer

Key takeaways

DXF is the safe defaultMost CAM software imports DXF cleanly; JPEG and PNG carry no machinable vectors.
Units cause the most scrapA 10 mm circle must stay 10 mm after import, not 10 inches.
Contours must be closedPocketing and profiling need one closed polyline with no gaps or doubled lines.
Text is not geometryExplode fonts into paths before export, or the toolpath will fragment.
Check one known dimensionMeasure a 100 mm reference line in CAM before generating any toolpath.
Why files fail

Why a clean 2D drawing still fails in CAM

Most 2D conversion problems are not software bugs. They come from the drawing itself. A line that looks continuous on screen may be three separate segments with hairline gaps at the joints. CAM software reads geometry, not appearance, so those gaps stop pocketing and profiling operations.

The second common cause is layer and color confusion. Designers often place outline, centerline, dimension, and hatching on one layer. CAM then treats dimension lines as cut paths. Keep one layer for cutting contours, one for reference, and delete or freeze everything else before export.

The third cause is unit mismatch. DXF stores coordinates as numbers and a header that says what those numbers mean. If the header says inches but the designer drew in millimeters, the part arrives 25.4 times too large. The machine will still cut it, and the material is gone.

  • 1
    Geometry, not pixelsRaster images cannot generate a toolpath.
  • 2
    One layer per purposeCut contours, reference, and text belong apart.
  • 3
    Units live in the headerWrong header means wrong part size.
Formats

Which 2D formats CAM software actually accepts

DXF is the standard exchange format for 2D machining, laser cutting, and waterjet work. It carries lines, arcs, polylines, and splines as vector data, and every mainstream CAM package reads it. DWG works too, but version differences between AutoCAD releases cause more import errors than DXF.

PDF is a print format. Some CAM tools can trace a PDF, but the result is an approximation, not your original geometry. If a PDF is all you have, rebuild the outline rather than trusting an auto-trace. SVG often contains nested groups, clipping masks, and unsupported elements; strip those before import or the contour will break.

Raster files such as JPEG, PNG, and scanned TIFF contain no machinable vector data. They are fine as a visual reference next to the DXF, not as the source. If your part only exists on paper, dimension it and redraw it as vectors.

  • 1
    DXFBest all-round choice for milling and turning profiles.
  • 2
    DWGAcceptable, but watch the saved version.
  • 3
    SVG and PDFClean or rebuild before use.
  • 4
    JPEG, PNGReference only, never a toolpath source.
Geometry

Cleaning geometry before you convert 2D file for CNC machine

Start with an overkill pass. Run a cleanup command to remove zero-length lines, duplicate entities, and stray points. Then use a join or polyline edit tool to merge connected segments into single polylines. A profile that should be one closed loop but is actually 40 short lines is a common source of CAM warnings.

Close every contour that will be cut or pocketed. Join the endpoints, then verify with an area or list command. A truly closed polyline reports a valid area; an open one does not. Gaps smaller than 0.001 mm still break offset calculations, so do not rely on visual inspection at zoom level.

Explode text, dimensions, and hatching into plain geometry, or delete them. TrueType fonts often convert into fragmented outlines with self-intersections. For engraved markings we keep character height at 1.5 mm or larger, because smaller strokes wear tools and blur the cut.

Check for self-intersecting and overlapping entities. Two lines running on top of each other double the toolpath and can trip a gouge check. Where a slot meets an outer edge, trim the overlap so the geometry has one clean boundary.

  • 1
    Overkill firstDelete zero-length lines, duplicates, and points.
  • 2
    Join and verifyClosed polylines report a valid area.
  • 3
    Explode textFragmented font outlines cut badly.
  • 4
    Trim overlapsDoubled geometry doubles the toolpath.
Units

Units, scale, and the one dimension you must verify

Set drawing units in the CAD file before export, not in CAM after import. If the part is metric, set millimeters; if imperial, set inches. Mixed-unit drawings are the hardest to repair because some entities were drawn at one scale and some at another.

Insert one known reference dimension, such as a 100 mm line or a 4.000 in line, and keep it on a separate layer. After import, measure that line in CAM. If it reads 100 mm, the scale is correct. If it reads 3.937 in or 2540 mm, stop and fix the units before doing anything else.

Watch the decimal precision on export. Twelve decimal places create noise in the file; two or three are enough for most machined profiles. For a ±0.005 mm tolerance we still import the original full-precision DXF and let CAM handle the rounding.

Do not scale geometry to make it fit a stock size. Scale changes every dimension, including hole diameters and thread callouts. Adjust the stock or the setup instead.

  • 1
    Set units in CADNot in CAM after the fact.
  • 2
    One reference line100 mm or 4.000 in, measured after import.
  • 3
    Reasonable precisionThree decimals is plenty for profiles.
  • 4
    Never scale to fitIt changes hole sizes too.
Export

Export settings that keep the file readable

Export as DXF R12 or R14 unless your CAM software asks for a newer release. Older versions carry fewer object types and import more reliably across packages. Save splines as polylines when the CAM tool cannot offset splines, and set a chord tolerance of 0.01 mm or finer.

Write the DXF in model space at 1:1. Paper space layouts, viewport scales, and title blocks confuse many importers. If the drawing must keep its title block, move the cutting geometry into model space and reference the border separately.

Keep the file to one part per DXF when the parts will be nested later. Multi-part sheets are fine for laser and waterjet, but for milling we prefer a single contour set per file so setup and work offset stay clear.

Finally, name layers by function: CUT, ENGRAVE, REF. CAM operators map toolpaths by layer, and clear names cut programming time and mistakes.

  • 1
    DXF R12 or R14Broadest import compatibility.
  • 2
    Model space, 1:1No viewport scaling.
  • 3
    One part per fileCleaner work offsets for milling.
  • 4
    Name the layersCUT, ENGRAVE, REF.
Workflow

Step by step: convert 2D file for CNC machine

Follow this order. Skipping ahead to CAM import is where most rework starts.

  • 1
    1. Find the true sourceLocate the native CAD file, not a PDF or screenshot. If only a print exists, redraw it with dimensions before anything else.
  • 2
    2. Set units and scaleSet the drawing to millimeters or inches and confirm it is 1:1 in model space. Add a 100 mm or 4.000 in reference line on its own layer.
  • 3
    3. Clean the geometryRun overkill to remove zero-length lines, duplicates, and points. Delete construction lines, dimensions, and hatching you do not need.
  • 4
    4. Join and close contoursJoin connected segments into polylines and close every cut or pocket boundary. Confirm closure with an area or list check, not by eye.
  • 5
    5. Explode text and outlinesConvert text you want engraved into vector paths. Keep character height at 1.5 mm or above. Delete text you do not want cut.
  • 6
    6. Trim overlaps and self-intersectionsWhere a slot meets an edge or two lines overlap, trim to one clean boundary so the toolpath offset has no ambiguity.
  • 7
    7. Export DXF at 1:1Save as DXF R12 or R14 from model space. Use a chord tolerance of 0.01 mm or finer for any spline converted to polyline.
  • 8
    8. Verify after importMeasure the reference line in CAM, check that contours are closed, and confirm the offset direction before posting the toolpath.
Format check

2D file formats for CNC conversion

Use this when deciding what to send your machine shop.

FormatVector dataTypical useRisk to watch
DXFYesMilling, turning, laser, waterjetWrong unit header in old files
DWGYesNative CAD exchangeVersion mismatch on import
SVGPartlyWeb and laser graphicsClipping masks, nested groups
PDFTraced onlyReference and drawing reviewAuto-trace changes dimensions
JPEG / PNGNoVisual reference onlyNo toolpath possible
STEP / IGES3D3D milling and turningNot a 2D contour source

The short version

A DXF in millimeters, 1:1 in model space, with closed contours and no stray layers, will convert cleanly in almost every CAM package. Fix the source file instead of patching the toolpath.

FAQs

2D file conversion questions

Can CAM software convert a JPEG into a cut path?

No. A JPEG stores pixels, not geometry, so there are no lines or arcs for the software to offset. Some tools offer auto-trace, but the result approximates your outline and rarely holds a tolerance.

Redraw the part as vectors from dimensions, then export DXF. If the shape is complex, trace it once in CAD and clean the result before cutting.

Why does my DXF import 25.4 times too large?

The DXF header says inches while the geometry was drawn in millimeters, or the opposite. CAM reads the header and scales the numbers accordingly, so a 10 mm feature becomes 10 in.

Fix units in the CAD file, re-export, then measure a known reference line in CAM before generating a toolpath.

Do I need to close contours for a simple profile cut?

Yes, for any pocket, bore, or through-cut that follows a loop. Open geometry stops the offset calculation and the CAM tool may refuse to generate the path.

For a single open line such as a slot centerline, an open polyline is fine, but keep it on a separate layer so it is not mistaken for a cut contour.

What tolerance should I use when converting splines to polylines?

Use a chord tolerance of 0.01 mm or finer for profiles that carry a ±0.005 mm tolerance. Coarser settings flatten curves and push dimensions out of spec.

If the CAM software supports splines directly, import them as splines and skip the conversion. Fewer conversions mean fewer chances to lose accuracy.

How many parts should one DXF contain?

For milling, one part per file keeps work offsets and setup sheets clear. For laser and waterjet, a nested sheet of many parts is normal.

If you send a multi-part sheet for milling, mark each part with its own layer and note the quantity in the drawing notes.

Can you check my 2D file before machining?

Yes. Send the DXF or DWG and we run a DFM review, checking units, contour closure, layer structure, and features that may be hard to hold.

We return the review with the quotation, usually within 12 hours, and note anything that needs correction before production.

Send your 2D file for review

We check units, contour closure, and layer structure before quoting, and reply within 12 hours with a DFM note.

12-hour quoteFree DFM analysisNDA on request

Follow us

More machining notes

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC