autoroute_pcb
Automate PCB trace routing: export the board, run Freerouting, and import the routed traces into a new file without altering the original.
Instructions
Autoroute PCB traces using the Freerouting autorouter.
Exports the board to Specctra DSN format, runs Freerouting for automated
trace routing, and imports the results into a new PCB file. The original
board is never modified.
Requires Java 17+ and KiCad's pcbnew Python bindings, whose major version
has to match the board's format era. On first run, the Freerouting JAR is
auto-downloaded (~20MB).
Args:
pcb_path: Path to .kicad_pcb file. Optional; omit to use the configured default.
max_passes: Maximum autorouter optimization passes
num_threads: Thread count for routing. Defaults to 1 because
freerouting prints "Multi-threaded route optimization is broken
and it is known to generate clearance violations" on every run.
Raise it only if you are willing to DRC the result carefully.
timeout: Max seconds to wait for routing (default: 600)
output_dir: Directory for output files (default: same as PCB).
Optional; omit to use the configured default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| pcb_path | No | ||
| max_passes | No | ||
| output_dir | No | ||
| num_threads | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warnings | No | ||
| vias_added | Yes | ||
| routed_path | Yes | ||
| traces_added | Yes | ||
| drc_violations | No | ||
| drc_unconnected | No | ||
| keepouts_promoted | No | ||
| text_fields_fixed | Yes |