pcb_cleanup_tracks
Deletes tiny stray track stubs and merges collinear, same-net segments on a PCB. Runs sliver cleanup, safe collinear merging, or both to tidy routed copper without breaking connectivity.
Instructions
Tidy stray track geometry: delete slivers and/or merge collinear runs.
Modes:
"slivers" (default): delete every track shorter than min_length_mils. Catches the zero/near-zero stubs left behind by editing.
"merge": join two collinear, same-layer, same-width, same-net tracks that meet end to end into a single track. The merge only fires when the shared point is a clean degree-2 junction (exactly those two track ends, with no via, pad, arc, or third track present), so it is safe to run on routed copper without breaking connectivity.
"both": slivers pass, then merge pass.
Args: mode: "slivers", "merge", or "both" (default "slivers"). min_length_mils: Sliver threshold (default 1).
Returns: {"slivers_deleted", "merged", "mode"}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | slivers | |
| min_length_mils | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||