Add diagonal=True to the exact router: after orthogonal routing, each 2-pin net is retried as the shortest exactly-clean octilinear (0/45/90/135-degree) trace. A dropped net is recovered; an orthogonal route is replaced only when the diagonal is strictly shorter. Candidates are the direct 45-degree segment or the two diagonal-plus-axis two-benders; each segment's diagonal copper is covered by the exact octagon and its clearance checked with clearance_conflict_shape, so a trace fits a diagonal corridor the bounding-box cover would reject. Endpoints stay on the pads; diagonal copper is stored with its exact octagon so later nets clear it precisely; same-net copper is ignored during the check so the candidate is verified against every other net before the orthogonal copper is ripped. With diagonal=False the pass is skipped and output is byte-for-byte the orthogonal router. Threaded through route_dsn_board_exact / build_exact_routing_result / route(engine="exact").
freeroute
A native Python PCB autorouter — a Java-free port of the FreeRouting engine.
Why
kicad-mcp currently autoroutes by shelling out to freerouting.jar, which
drags in a JVM dependency. freeroute reimplements the routing engine in
pure Python so the toolchain needs no Java at all.
The contract
The entire integration surface is two Specctra files:
board.dsn ──▶ freeroute ──▶ board.ses
(unrouted) (routed session: traces + vias)
kicad-cli already exports .dsn and imports .ses, so freeroute is a
drop-in replacement for the JAR step — nothing else in the pipeline changes.
Status
Pre-alpha. Under active development. See docs/PORTING_PLAN.md
for the architecture and porting roadmap.
Usage (target)
freeroute board.dsn -o board.ses
Development
uv sync
uv run pytest
uv run ruff check src/ tests/
License
GPL-3.0-or-later, matching the FreeRouting source it is ported from.
Languages
Python
100%