Skip to content
Engineering File Tools

How to Check a DXF for Open Contours (and Fix Them in CAD)

Last reviewed November 30, 2026

To check a DXF for open contours, connect all line, arc and polyline endpoints into a graph and look for endpoints that touch nothing: every endpoint that is used only once marks an open contour. The free DXF Open Contour Checker does this in your browser, highlights each open endpoint and gap, and lists coordinates, entity handles and layers so you can fix them in CAD.

This guide explains what counts as an open contour, why CAM and nesting software reject it, how the check works, how to choose the tolerance, how to close gaps in CAD and what this kind of check cannot see.

What an open contour is

A contour is a chain of entities (LINE, ARC, polyline segments and so on) that together describe one edge of a part: the outer profile or a hole. It is closed when you can follow it from any point and come back to the start without jumping.

It is open when the chain has a loose end. Typical causes:

  • Two lines that should meet stop 0.05 mm apart, often from rounding during export or a corner drawn by eye.
  • A segment is missing completely.
  • An arc's endpoint does not exactly match the neighbouring line because the arc was drawn from center and radius instead of being snapped.
  • A part was exploded and some segments were deleted or moved.

On screen these gaps are usually invisible. At 0.05 mm you would need to zoom in a long way to see them.

Why CAM and nesting software reject open contours

Laser, plasma and waterjet CAM systems need closed loops to decide what is material and what is scrap. With a closed contour the software can:

  • tell inside contours (holes) from outside contours,
  • apply kerf compensation to the correct side,
  • place lead-ins and lead-outs,
  • calculate the part area for nesting.

With an open contour none of this is defined. Depending on the software, the file is rejected, the contour is cut as an open path without compensation, or the part is not cut free from the sheet. Many CAM systems have their own join tolerance that silently closes small gaps, but you cannot rely on every shop using the same setting.

How the endpoint graph check works

The checker treats every endpoint as a node and every entity as an edge between its start and end point:

  1. Read all LINE, ARC and open polyline entities from model space. Circles, full ellipses and closed polylines are closed by definition.
  2. Group endpoints that lie within the tolerance of each other into one node.
  3. Count how many entity ends meet at each node (its degree).
  4. Evaluate each connected chain:
Node degreeMeaningResult
1Only one entity ends hereOpen endpoint, the contour is open
2Exactly two entities meetNormal connection; if every node in the chain has degree 2, the contour is closed
3 or moreThree or more entities meet at one pointBranch, the contour is ambiguous and marked "needs review"

This means a closed rectangle made of four separate LINE entities is recognised as closed, just like a single closed polyline. Mixed chains of lines, arcs and polyline segments are handled the same way.

When a degree-1 endpoint has another degree-1 endpoint within 10 × the tolerance, the checker reports a gap with the measured distance. That is the most common case: two ends that were meant to meet but miss by a small amount.

Choosing the tolerance

The tolerance is given in drawing units. The default is 0.01, which means 0.01 mm in a millimetre drawing. You can change it.

Example with the default tolerance of 0.01 mm:

Distance between two endpointsResultWhy
0.004 mmConnected0.004 is within the tolerance of 0.01
0.05 mmReported as a gap of 0.05 mm, both ends openLarger than 0.01, but within 10 × 0.01 = 0.1 mm
0.3 mmTwo separate open endpointsLarger than 0.1 mm, so the ends are not paired as a gap

How to pick a value:

  • Too small (for example 0.000001): harmless floating-point noise from CAD exports is reported as gaps.
  • Too large (for example 0.5 mm in a part with 0.3 mm details): real gaps are treated as connected, and small features may be merged. The checker would report a contour as closed that the CAM system still sees as open.
  • Practical approach: use the join tolerance that your CAM system or your laser shop applies. If you do not know it, keep the default, then look at each reported gap.

Remember that the tolerance follows the drawing unit. In an inch drawing, 0.01 means 0.01 in, which is 0.254 mm.

Step by step: checking a file with our tool

  1. Open the DXF Open Contour Checker.
  2. Drop your .dxf file into the page. It is processed locally in your browser and not uploaded.
  3. If the file has no unit ($INSUNITS is 0 or missing), select mm or inch.
  4. Focus on the cutting layers. Construction lines, frames and dimensions on other layers are irrelevant for the laser and only add noise.
  5. Keep the default tolerance of 0.01 or set the value your CAM system uses.
  6. Run the check and read the summary: number of closed contours, open contours and contours that need review.
  7. Look at the highlighted issue points in the drawing and note the coordinates, entity handle and layer of each one.
  8. Fix the problems in CAD, export again and repeat the check until no open contours remain.
  9. Also run the Duplicate Line Checker: duplicate segments create degree-3 or degree-4 nodes and show up here as branches.

How to fix open contours in CAD

In AutoCAD and similar programs:

  • JOIN: select the segments of one contour and join them into a single polyline. This works only if the endpoints coincide; the result tells you how many objects were joined.
  • PEDIT → Multiple → Join with a fuzz distance: joins segments whose ends are close but not identical, for example with a fuzz distance of 0.1 mm. Use the smallest value that closes the gap.
  • EXTEND and TRIM: extend a line that stops short, or trim one that overshoots, to the neighbouring edge.
  • FILLET with radius 0: quickly closes a corner between two lines that do not quite meet.
  • Redraw the segment: if a piece is missing entirely, draw it with object snaps on endpoints.

After fixing, a good sign is that each contour has become one closed polyline. Check again before sending the file.

What the checker does NOT detect

The endpoint method only looks at where entities start and end. It cannot see:

  • T-junctions in the middle of a span: a line that ends on the middle of another segment. That endpoint has degree 1 and is reported as open, but the checker does not recognise that it touches the other segment.
  • Self-intersections: a contour that crosses itself, like a figure eight drawn as one loop.
  • Crossing or overlapping contours: two closed contours that intersect each other.
  • Partial overlaps: a short line lying on top of part of a longer line. The duplicate checker does not detect these either.

Limitations

  • The result is a preflight, not a manufacturability guarantee. A contour can be closed and still be too small, too narrow or wrongly placed for your machine.
  • Only model space is analysed; TEXT, MTEXT, DIMENSION and HATCH are not part of the check.
  • The outcome depends on the tolerance you choose. Large tolerances can hide real gaps.
  • DWG files are not supported; convert them to DXF first.