2.6 KiB
Routing examples
Run these scripts from the repository root after installation. Each script saves a PNG alongside its source.
python examples/01_simple_route.py
Start with a connection
Use the quick start to connect two ports with copyable code. For perpendicular and opposing headings, compare the port orientations example with its route plot.
Route around fixed geometry
The straight route is fixed, so the second route loops around its left end. Run the locked-path example to reproduce the detour. To pass a fixed route into your own layout, follow the route reuse workflow.
Fit bends to available room
The short path fits a small offset with an S-bend. The longer path has room for a pair of right-angle bends. Run S-bends and radii to see both geometries.
| Example | What to look for | Preview |
|---|---|---|
| Bend proxies | How an arc, a box proxy for an arc, and a custom physical bend affect the route. | Bend model comparison |
| Custom bends | A route whose search proxy and physical bend use different polygons. | Custom bend overlay |
Diagnose congestion or an incomplete route
| Example | What to look for | Preview |
|---|---|---|
| Congestion resolution | How rerouting separates nets competing for the same space. | Separated routes |
| Best-effort result | Where a path stops with a small node budget. Try node_limit=500 to complete it. |
Budget comparison |
| Fan-out | How search states cluster around a bottleneck. The example adjusts the heuristic between iterations through the internal worker. | Fan-out search overlay |
In physical overlays, dashed outlines show search proxies and solid outlines show physical geometry. Inspect clearance using the solid outlines. For red paths, look up result.outcome in the result guide.

