A third engine (engine='room') that replaces the fixed routing grid with FreeRouting's free-space rooms. Per layer, the space not occupied by items (inflated by the routing clearance) is decomposed into exact rectangles via coordinate compression (the orthogonal analogue of CompleteFreeSpaceExpansionRoom); adjacent rooms share an edge door, and a via door joins overlapping rooms on two layers. The maze search is an A* over rooms-through-doors (cost = geometric distance + via cost), so a path may cross a door anywhere along its width rather than at a quantized cell. The found room sequence is realized into an exact orthogonal Polyline through the door mid-gates and verified DRC-clean against the ShapeSearchTree, dropping the net if it cannot be made exactly clean. Maps to autoroute/: ExpansionRoom / CompleteFreeSpaceExpansionRoom (rooms), ExpansionDoor / TargetItemExpansionDoor (doors), MazeSearchAlgo / AutorouteEngine (search), LocateFoundConnectionAlgo (realization). Foundation scope: rooms are axis-aligned rectangles (not general Simplex tiles); realization uses an L-connector through door mid-gates. Any-angle rooms, optimal gate placement (true sub-cell shove), and optimization passes are follow-ups. The grid and exact tracks are unchanged; this is opt-in. Routes simple/crossing (with a via) and all four multi-pin nets of the real KiCad board, DRC-clean.
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
"""Autorouting for freeroute.
|
|
|
|
An MVP grid-based maze router and the DSN-in / SES-out pipeline that makes
|
|
freeroute a Java-free replacement for the ``freerouting.jar`` step::
|
|
|
|
from freeroute.route import route
|
|
ses_text = route(dsn_text)
|
|
|
|
The router (:class:`GridRouter`) is intentionally simple — single-layer A* over
|
|
a uniform occupancy grid, enough to reach connectivity on boards whose nets
|
|
route without crossing. FreeRouting's free-space expansion-room maze, rip-up,
|
|
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_exact_routing_result,
|
|
build_rooms_routing_result,
|
|
build_routing_result,
|
|
route,
|
|
route_dsn_board,
|
|
route_dsn_board_exact,
|
|
route_dsn_board_rooms,
|
|
)
|
|
from .room_router import route_board_rooms
|
|
|
|
__all__ = [
|
|
"GridRouter",
|
|
"RouteResult",
|
|
"route_board",
|
|
"route",
|
|
"route_dsn_board",
|
|
"build_routing_result",
|
|
"ExactRouteResult",
|
|
"route_board_exact",
|
|
"build_exact_routing_result",
|
|
"route_dsn_board_exact",
|
|
"route_board_rooms",
|
|
"build_rooms_routing_result",
|
|
"route_dsn_board_rooms",
|
|
]
|