DXF node optimizer
Curves exported as thousands of tiny line segments make laser cutters and CNC controllers stutter. This cleans up your DXF's polylines — far fewer points, the same shape within the tolerance you choose. Everything runs in your browser.
Why CAM files balloon, and what a tolerance really means
A traced or exported drawing rarely contains the elegant arcs a human would draw. Vectorised scans, flattened splines and CAD exports describe every curve as hundreds of tiny straight segments, and every one of those segments is a node your CNC controller has to read, buffer and execute. The visible symptoms are familiar: files that take an age to load, laser heads that stutter around curves because the controller cannot look far enough ahead, and toolpaths that crawl. Reducing nodes is not cosmetic — on many machines it directly smooths and speeds the cut.
Choosing the tolerance like a machinist
The tolerance is a promise: no simplified point will sit further from the original line than this distance. That gives you an objective way to pick it — set it below what your process can physically resolve. A laser with a 0,2 mm kerf cannot express a 0,05 mm wiggle in the path, so removing that wiggle costs nothing. Start small, watch the live before-and-after node counter, and raise the tolerance a step at a time; the first steps usually remove the vast majority of nodes while the deviation stays far below anything the machine could cut. True arcs, circles and text are deliberately left untouched — only polylines are thinned, because that is where traced geometry hides its bulk.
Where this fits in the workflow
The heaviest files usually arrive from vectorisation, so a pass through this tool right after Image to DXF or PDF to DXF is the natural habit — trace first, thin second, then measure and rescale in CAD. And if the parts are headed for a shared sheet of material, a lighter file also makes the DXF nesting tool noticeably faster, since it rasterises every outline you give it.
How it works — and its honest limits
This runs the Ramer–Douglas–Peucker algorithm on every polyline: it keeps the points that define the shape and drops the ones that lie within your tolerance of the straight line between them. The maximum deviation is bounded by that tolerance, so a 0.05-unit setting never moves the outline more than 0.05 units — no dimensional loss beyond the value you pick. Raise the tolerance for a smaller file, lower it to stay closer to the original. Two honest limits: it simplifies polylines (the usual culprit for bloated CAM files) but leaves true arcs, circles and text untouched, and it reduces nodes rather than re-fitting them as spline arcs — a heavier feature we may add later.
Will it change my dimensions?
Only within the tolerance you set. At 0.05 units the outline never shifts more than 0.05 units from the original; set it to 0 and nothing is removed. Pick a tolerance well below your machining accuracy and the part stays exactly on-spec while the point count drops.
Why is my file still large?
This targets polylines — the usual cause of huge CAM files exported from splines or contours. If your DXF is big for other reasons (many separate entities, blocks, text), the point count won't drop much. Watch the before → after node count as you change the tolerance to see the effect live.
Is anything uploaded?
No. The DXF is read, simplified and written back entirely in your browser — nothing is sent to a server or stored.
