Preserve bend geometry through refinement and validate joins

This commit is contained in:
Jan Petykiewicz 2026-11-27 15:51:53 -08:00
commit 489c20847a

View file

@ -25,14 +25,14 @@ The fields below appear in constructor order. Use one layout unit for coordinate
| --- | --- | --- |
| `bounds` | Required | Finite board rectangle as `(xmin, ymin, xmax, ymax)`, with each minimum below its maximum. |
| `nets` | `()` | Sequence of `NetSpec` objects with unique IDs. Duplicate IDs raise `ValueError`. |
| `static_obstacles` | `()` | Shapely polygons that define keepouts. |
| `static_obstacles` | `()` | Valid, nonempty Shapely `Polygon` objects that define keepouts. |
| `initial_paths` | Empty mapping | Net IDs mapped to `PathSeed` objects. |
| `clearance` | `2.0` | Finite, nonnegative spacing required between physical shapes. |
| `safety_zone_radius` | `0.0021` | Tolerance for small obstacle intersections at a move's endpoints during search. |
## Path seeds
`PathSeed(segments)` holds an ordered tuple of `StraightSeed(length)`, `Bend90Seed(radius, direction)`, and `SBendSeed(offset, radius)` moves. Lengths and radii must be finite and positive. Bend directions are `"CW"` and `"CCW"`. S-bend offsets must be nonzero integers with magnitude less than twice the radius. A seed is materialized from the net's current start port using its width and the run's geometry options. Search skips seeds with a bend radius below half the net width. For a workflow that starts from an existing route, see [Reuse an existing route](route-a-layout.md#reuse-an-existing-route).
`PathSeed(segments)` holds an ordered tuple of `StraightSeed(length)`, `Bend90Seed(radius, direction)`, and `SBendSeed(offset, radius)` moves. Lengths and radii must be finite and positive. Bend directions are `"CW"` and `"CCW"`. S-bend offsets must be nonzero integers with magnitude less than twice the radius. A seed is materialized from the net's current start port using its width and the run's geometry options. A radius absent from the corresponding option list raises `ValueError`. Search skips seeds with a configured bend radius below half the net width. For a workflow that starts from an existing route, see [Reuse an existing route](route-a-layout.md#reuse-an-existing-route).
## Results
@ -67,11 +67,11 @@ To read a route's polygons and write them to a test file, follow the [geometry e
| Field | Default | Effect |
| --- | --- | --- |
| `node_limit` | `1_000_000` | Per-search expansion ceiling. Automatic uses smaller budgets for its initial stages. |
| `min_straight_length` | `5.0` | Minimum length for regular forward moves in lattice search. |
| `max_straight_length` | `2000.0` | Maximum distance the forward scan uses to propose straight moves in lattice search. |
| `min_straight_length` | `5.0` | Finite, nonnegative minimum length for regular forward moves in lattice search. |
| `max_straight_length` | `2000.0` | Finite, positive maximum distance for the forward scan in lattice search. |
| `greedy_h_weight` | `1.5` | Weight on the estimated cost still needed to reach the target. Lower values give more influence to the cost of the path so far. |
| `bend_radii` | `(50.0, 100.0)` | Permitted radii for 90-degree bends. Each move needs a radius of at least half its net width. |
| `sbend_radii` | `(10.0,)` | Permitted S-bend radii, subject to the same width requirement. |
| `bend_radii` | `(50.0, 100.0)` | Finite, positive radii permitted for 90-degree bends in search and seeds. Each move needs a radius of at least half its net width. An empty list disables 90-degree bends. |
| `sbend_radii` | `(10.0,)` | Finite, positive radii permitted for S-bends in search and seeds, subject to the same width requirement. An empty list disables S-bends. |
| `sbend_offsets` | `None` | `None` lets the router choose signed lateral offsets. An explicit list restricts routing and seeds to those offsets after rounding to the grid. An empty list disables S-bends. |
| `bend_collision_type` | `"arc"` | Search proxy, one of `"arc"`, `"bbox"`, or `"clipped_bbox"`. The legacy polygon form defines both shapes unless split geometry is supplied. |
| `bend_proxy_geometry` | `None` | Override the proxy. A custom polygon proxy by itself keeps the standard physical arc and emits a warning. |