fix_laser_svg
Repairs laser-cutting SVGs into millimetre files: removes zero-length segments, maps colours to cut/score/engrave, merges double cuts, closes small gaps, and optionally applies kerf compensation.
Instructions
Apply the safe automatic repairs to an SVG and write a clean millimetre SVG: real size in mm, zero-length segments removed, colours mapped to cut (red hairline) / score (blue) / engrave (black fill), fill-only shapes turned into cut outlines when unambiguous, double cuts merged, small gaps closed. Optional kerf compensation. Never changes bridges, holes or slot widths.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "fix_laser_svg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | No | SVG text, instead of a path. | |
| path | No | Path to a local .svg or .dxf file. | |
| kerf_mm | No | If > 0, offset cut outlines by kerf/2 so parts come out at drawn size. | |
| colour_map | No | Override the layer guess per style key, e.g. {"stroke:#e8251b": "cut"}. Layers: cut, score, engrave, remove, keep. | |
| gap_max_mm | No | Close open ends up to this gap (default 0.2). | |
| output_path | No | Where to write the resulting SVG. If omitted, the SVG text is returned in the result. |