inire/README.md
Jan Petykiewicz 42e1de9884 Keep route placement at the layout writer boundary
Use the effective net, seed, and search settings as the placement recipe. Remove the export-grid, whole-layer, and CPW mask assembly helpers and cover replay from resolved ports.
2026-11-29 16:36:32 -08:00

51 lines
1.9 KiB
Markdown

# inire
Use Inire to connect ports on a photonic or RF layout with straight segments, 90-degree bends, and S-bends. Supply each connection's port coordinates and travel directions, along with the board bounds, keepouts, and allowed bend radii. Each result reports whether the route reached its target and passed verification. A search that stops early can return a partial path.
## Install
From a checkout with Python 3.11 or newer, run `pip install .`.
## Route a net
```python
from inire import (
NetSpec, Port, RoutingProblem,
route,
)
start = Port(50, 100, 0)
target = Port(250, 100, 0)
net = NetSpec("input", start, target)
problem = RoutingProblem(
bounds=(0, 0, 1000, 1000),
nets=(net,),
clearance=2,
)
run = route(problem)
result = run.results_by_net["input"]
if result.is_valid:
print(result.report.total_length)
else:
print(result.outcome)
```
![A short solid waveguide connects the start at (50, 100) and target at (250, 100). Both port arrows point east.](docs/figures/first-route.png)
The example prints `200.0` in the layout's coordinate unit. Both ports use heading 0 because the path leaves the source and enters the target travelling east. Use `result.as_seed()` to [save the placement recipe](docs/user/route-a-layout.md#save-a-placement-recipe).
## Route your own layout
- For your own ports and keepouts, follow the [layout workflow](docs/user/route-a-layout.md#define-the-inputs).
- If a path stops short, work through the [partial route checks](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short).
- To find examples and look up fields as you work, use the [user guide](DOCS.md).
## Develop Inire
- To set up the development environment and find the relevant routing code, use the [developer guide](docs/development.md).
- To measure routing coverage, cost, or runtime, run the [routing benchmarks](docs/benchmarks.md).
## License
Inire is distributed under the [GNU Affero General Public License v3](LICENSE.md).