Add exact-geometry (orthogonal, DRC-clean) routing track

Adds route/exact_router.py: routes with the grid track's rip-up/multi-layer/
via topology search in orthogonal mode (axis-aligned segments -> exact IntBox
copper), then verifies clearance exactly against a ShapeSearchTree. A net
whose copper would come closer than the clearance to any accepted item is
dropped, so the emitted geometry is DRC-clean by construction; endpoints stay
exactly on pads and vias at real layer transitions.

GridRouter gains a non-breaking orthogonal option (4-connected). The pipeline
gains an engine= selector: 'grid' (default, unchanged, highest coverage) or
'exact' (DRC-verified). The grid MVP stays the fallback.

On the designed boards the exact track routes every net DRC-clean; on the
real KiCad board it matches the grid's connectivity (4/4 multi-pin nets) and
is DRC-clean where the grid MVP's widened centrelines are not. Deferred:
shove, and 45-degree/IntOctagon trace caps.

Tests: the exact router's output has no clearance violation (exact IntBox
check) on every fixture; endpoints on pads; traces orthogonal; crossing uses
a via; and a direct comparison showing the exact track is clean where the
grid MVP violates on the real board. Oracle-gated parity for engine='exact'.
This commit is contained in:
2026-07-13 02:16:23 -06:00
parent b200ecf6f8
commit 0bee385e71
5 changed files with 356 additions and 11 deletions
+12 -1
View File
@@ -14,8 +14,15 @@ multi-layer via search, and shove are deferred.
from __future__ import annotations
from .exact_router import ExactRouteResult, route_board_exact
from .grid_router import GridRouter, RouteResult, route_board
from .pipeline import build_routing_result, route, route_dsn_board
from .pipeline import (
build_exact_routing_result,
build_routing_result,
route,
route_dsn_board,
route_dsn_board_exact,
)
__all__ = [
"GridRouter",
@@ -24,4 +31,8 @@ __all__ = [
"route",
"route_dsn_board",
"build_routing_result",
"ExactRouteResult",
"route_board_exact",
"build_exact_routing_result",
"route_dsn_board_exact",
]