Ryan Malloy 1599d181b5 Add TileShape and Simplex convex-shape core
Ports geometry/planar/TileShape.java (the border-line-based containment,
area, and centre-of-gravity logic) and Simplex.java (a convex region as
the intersection of directed half-planes). Corners are exact
intersections of consecutive border lines; point containment uses exact
side_of. The remove_redundant_lines normalization — dropping lines that
do not contribute and detecting emptiness — is ported line-for-line.

Supporting additions: Line.compare_to/__lt__ (angular sort order),
Line.fast_equals, Line.side_of_intersection, Line.translate (perpendicular
offset), IntDirection.determinant, and IntBox.to_simplex.

offset is approximate (rounded translated lines, as upstream); enlarge
clips to the enlarged bounding box pending the IntOctagon port.

Since there is no JVM oracle, tests assert invariants: corners lie
exactly on their border lines (exact side_of == 0), IntBox -> Simplex
preserves the region over a sampled grid, intersection is contained in
both operands and a point is in the result iff in both, and get_instance
normalization drops redundant lines and detects empty half-plane pairs.
2026-07-11 18:36:20 -06:00

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.

Description
Native Python PCB autorouter — a Java-free port of the FreeRouting engine (Specctra DSN in, SES out)
Readme GPL-3.0 391 KiB
Languages
Python 100%