Document routing between placed crossings and archive development records

This commit is contained in:
Jan Petykiewicz 2026-11-26 21:37:05 -08:00
commit 2c260e5e95

View file

@ -10,15 +10,60 @@ Start with the [first route](../../README.md#route-a-net), then replace the exam
4. **Add keepouts.** Supply Shapely polygons in `static_obstacles` and use `bounds` for the board rectangle. Leave enough access at the ports for the guide and its permitted bends. [Input fields](api-reference.md#layout-inputs)
5. **Run and check.** Call `route(problem, options=options)` and check each `result.is_valid`. Start with automatic mode for general layouts. [Read the result](tune-and-troubleshoot.md#read-the-result)
## Connect a preplaced crossing
<a id="connect-a-preplaced-crossing"></a>
- Place the device and reserve its keepout first.
- Leave openings in the keepout at the physical ports.
- Define the external legs as separate nets. The placed cell supplies the internal connections.
## Route between placed crossings
![Four routed legs stop at labeled ports in the notched keepout of a preplaced crossing. Dashed links inside the cell indicate connections supplied by the device.](../figures/placed-crossing.png)
1. **Place the crossing cells.** Keep each cell's physical footprint and internal connections in your layout. Get the port positions and headings in board coordinates after applying placement and rotation.
2. **Reserve routing keepouts around the cells.** Use the device's routing keepout if supplied. Otherwise, start from its footprint and make local openings at the ports you're connecting. Keep the full physical cell in the exported layout.
3. **Route the external connections.** Give Inire one net per connection between devices. The example connects A's east port to B's west port. B's arrival heading points east into the cell.
Each leg meets a port at the end of an access slot. The dashed links show the device's internal connections schematically. The four external paths come from Inire's `crossing-single` fixture. [Crossing fixtures](../benchmark-fixtures.md#preplaced-crossings)
![Two offset rectangular crossing cells with finite footprints. The solid external waveguide leaves A's east port and enters B's west port. Small cutouts in the shaded keepouts allow port access.](../figures/placed-crossing.png)
Dashed outlines show the complete device footprints. Shading shows the keepouts passed to Inire. The external route connects the two port markers. The arrow at each marker shows the heading.
Inire applies `clearance` around the supplied keepout polygons. A straight approach of width `w` between two keepout edges needs at least `w + 2 * clearance` of open width. Leave room for any turn near the port and check the opening after snapping the port to the grid.
```python
from shapely.geometry import box
from inire import (
NetSpec, Port, RoutingOptions,
RoutingProblem, SearchOptions,
route,
)
# Example footprints and access openings in board coordinates.
a = box(30, 50, 80, 100)
b = box(260, 90, 310, 140)
a_access = box(74, 69, 82, 81)
b_access = box(258, 109, 266, 121)
a_keepout = a.difference(a_access)
b_keepout = b.difference(b_access)
net_id = "A_east_to_B_west"
link = NetSpec(
net_id,
Port(80, 75, 0),
Port(260, 115, 0),
width=2,
)
problem = RoutingProblem(
bounds=(0, 0, 340, 180),
nets=(link,),
static_obstacles=(a_keepout, b_keepout),
clearance=4,
)
search = SearchOptions(
bend_radii=(25,), sbend_radii=(25,),
)
opts = RoutingOptions(search=search)
run = route(problem, options=opts)
result = run.results_by_net[net_id]
assert result.is_valid
```
Before export, check the port joins and clearance against the actual placed-cell geometry. Inire verifies the external route against the keepouts you supplied.
## Reuse an existing route