2.5 KiB
2.5 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
- Simple route connects one pair of ports and checks validity. For copyable code and its plot, use the README quick start.
- Port orientations explores routes with perpendicular or opposing headings. Plot
Route around fixed geometry
The first route runs straight. The second must turn around its left end to reach the other side. Run the locked-path example, or use the public API workflow to pass fixed polygons into another run.
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.
- Bend proxies compares an arc, a box proxy for an arc, and a custom physical bend. Plot
- Custom bends provides separate physical and proxy polygons. Plot
Diagnose congestion or an incomplete route
- Congestion resolution separates nets that compete for the same space. Plot
- Best-effort result stops after a tiny search budget. Try
node_limit=500and compare the two outcomes on the troubleshooting page. - Fan-out overlays search states around a bottleneck. This advanced example adjusts the heuristic between iterations through the internal worker. Plot
In plots with a physical overlay, dashed outlines show search proxies and solid outlines show physical geometry. Use the physical outlines to inspect clearance and result.outcome to interpret red paths. Result guide

