Verify physical route clearance and board containment

This commit is contained in:
Jan Petykiewicz 2026-11-27 14:12:40 -08:00
commit c200d0f7c1
2 changed files with 210 additions and 173 deletions

View file

@ -24,7 +24,7 @@ The fields below appear in constructor order. Use one layout unit for coordinate
| Field | Default | Meaning |
| --- | --- | --- |
| `bounds` | Required | Board rectangle as `(xmin, ymin, xmax, ymax)`. |
| `nets` | `()` | Sequence of `NetSpec` objects with unique IDs. |
| `nets` | `()` | Sequence of `NetSpec` objects with unique IDs. Duplicate IDs raise `ValueError`. |
| `static_obstacles` | `()` | Shapely polygons that define keepouts. |
| `initial_paths` | Empty mapping | Net IDs mapped to `PathSeed` objects. |
| `clearance` | `2.0` | Required spacing between physical shapes. |
@ -42,7 +42,7 @@ The fields below appear in constructor order. Use one layout unit for coordinate
| `RoutingResult.is_valid` and `outcome` | `is_valid` is true when the outcome is `completed`. Read `outcome` to distinguish success, a failed geometry check (`colliding`), a path that stopped short (`partial`), or an empty path (`unroutable`). |
| `RoutingResult.path` | Ordered path components from the source to the last reached state. An unroutable result has an empty path. |
| `RoutingResult.reached_target` | Whether the path reached the target position and heading. With heading inference, the check uses the chosen heading. Read `is_valid` for the result of geometry verification. |
| `RoutingResult.report` | `total_length` in layout units plus static, dynamic, and self-collision counts. `out_of_bounds` records a board containment failure when checked. |
| `RoutingResult.report` | `total_length` in layout units plus static, dynamic, and self-collision counts. `out_of_bounds` indicates that physical geometry extends outside the board rectangle. |
| `RoutingResult.locked_geometry` and `as_seed()` | Physical polygons and the sequence of moves, respectively. Check validity before exporting polygons or using them as keepouts. |
| `RoutingRunResult.automatic` | In automatic mode, the selected planner, verified IDs, stage history, and any capacity or port-conflict bound. `None` for explicit modes. |
| `RoutingRunResult.topology` and `metrics` | Corridor counts and seed work when reported by the selected worker, plus work counters across the run. |

View file

@ -7,11 +7,11 @@ Start with `run.results_by_net[net_id].outcome`. It distinguishes a path that st
| `result.outcome` | What to inspect |
| --- | --- |
| `completed` | The path reached its target and passed verification. Read its length in `report.total_length` and follow the [geometry export steps](route-a-layout.md#export-verified-geometry). |
| `colliding` | The path reached its target and failed verification. Check `result.report` for keepout clearance, conflicts with another route, or self-overlap. In automatic mode, also check `report.out_of_bounds`. |
| `colliding` | The path reached its target and failed verification. Check `result.report` for keepout clearance, conflicts with another route, self-overlap, or geometry outside the board. |
| `partial` | Read the position and heading of `result.path[-1].end_port`. Check room for the path to continue from that heading. If the next turn fits, compare search limits. |
| `unroutable` | The path is empty. Check the launch heading and room for the first straight or bend. |
Check `is_valid` before exporting. With explicit `off`, `guide`, or `seed` mode, also check that the physical polygons fit the board if your export requires containment. Automatic mode includes that check in candidate verification.
Check `is_valid` before exporting. Every routing mode checks that the physical polygons fit within the board.
## Why a net stopped short