Tie routing documentation to user and developer workflows

This commit is contained in:
Jan Petykiewicz 2026-11-27 10:15:54 -08:00
commit 2c7a7ea90a

View file

@ -1,6 +1,6 @@
# Public API reference
Import the types on this page from `inire`. The [layout guide](route-a-layout.md) shows how to assemble a problem and the [tuning guide](tune-and-troubleshoot.md) explains which settings to try.
Import these types from `inire`. To see how the inputs fit together in a runnable design, start with the [layout guide](route-a-layout.md#define-the-inputs).
## Route a problem
@ -12,18 +12,23 @@ Omitting `options` uses `RoutingOptions()`. To observe live congestion iteration
## Layout inputs
- `Port(x, y, r)` snaps coordinates to the integer grid and normalizes the heading in degrees. Heading 0 points east and 90 points north. The heading must be a multiple of 90 after rounding.
- `NetSpec(net_id, start, target, width=2.0)` uses a unique ID and two ports. The target heading is the direction of arrival.
- `RoutingProblem` describes one routing layer. Use one unit for distances, coordinates, widths, and radii.
### Ports and nets
| Input | Meaning |
| --- | --- |
| `bounds` | Board outline as `(xmin, ymin, xmax, ymax)`. |
| `nets` | `NetSpec(net_id, start, target, width=2.0)` objects with unique IDs and `Port(x, y, r)` terminals. Defaults to an empty tuple. |
| `static_obstacles` | Shapely polygons for keepouts. Defaults to an empty tuple. |
| `initial_paths` | Mapping from net IDs to `PathSeed` objects. Defaults to an empty mapping. |
| `clearance` | Required spacing between physical shapes. Defaults to `2.0`. |
| `safety_zone_radius` | Tolerance for very small obstacle intersections at ports during search. Defaults to `0.0021`. |
- `Port(x, y, r)` snaps coordinates to the integer grid and normalizes the heading `r` in degrees. Heading 0 points east and 90 points north. The heading must be a multiple of 90 after rounding.
- `NetSpec(net_id, start, target, width=2.0)` uses a unique ID and two ports. The target heading is the direction of arrival.
### RoutingProblem
The fields below appear in constructor order. Use one layout unit for coordinates, widths, distances, and radii.
| Field | Default | Meaning |
| --- | --- | --- |
| `bounds` | Required | Board rectangle as `(xmin, ymin, xmax, ymax)`. |
| `nets` | `()` | Sequence of `NetSpec` objects with unique IDs. |
| `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. |
| `safety_zone_radius` | `0.0021` | Tolerance for very small obstacle intersections at ports during search. |
## Path seeds
@ -36,12 +41,13 @@ Omitting `options` uses `RoutingOptions()`. To observe live congestion iteration
| `RoutingRunResult.results_by_net` | A mapping from net ID to `RoutingResult`. |
| `RoutingResult.is_valid` and `outcome` | Final validity and a status of `completed`, `colliding`, `partial`, or `unroutable`. |
| `RoutingResult.path` | Ordered path components from the source to the last reached state. An unroutable result has an empty path. |
| `RoutingResult.reached_target` and `report` | Arrival status, physical length, and collision details. |
| `RoutingResult.reached_target` | Whether the path reached the target port with its required heading. |
| `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.locked_geometry` and `as_seed()` | Physical polygons for export or fixed obstacles, and the move sequence for reuse as a seed. |
| `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. |
Before using a route's physical polygons in your layout, follow the [export checks](tune-and-troubleshoot.md#read-the-result).
To read a route's polygons and write them to a test file, follow the [geometry export steps](route-a-layout.md#export-verified-geometry).
## Options and defaults
@ -109,6 +115,8 @@ Increase the iteration limit when later reroutes might resolve conflicts. Adjust
### TopologyOptions
For a layout that repeatedly stops short at an opening, `guide` can suggest a passage while letting search choose where to turn. To compare this with realizing a physical starting path in `seed`, see the [routing mode choices](tune-and-troubleshoot.md#choose-a-routing-mode).
| Field | Default | Effect |
| --- | --- | --- |
| `mode` | `"automatic"` | Select a [routing mode](tune-and-troubleshoot.md#choose-a-routing-mode). |