# Inire Routing Examples

This directory contains examples demonstrating the features and architectural capabilities of the `inire` router.

## Architectural Visualization
In all plots generated by `inire`, we distinguish between the search-time geometry and the final "actual" geometry:
*   **Dashed Lines & Translucent Fill**: The **Collision Proxy** used during the A* search (e.g., `clipped_bbox` or `bbox`). This represents the conservative envelope the router used to guarantee clearance.
*   **Solid Lines**: The **Actual Geometry** (high-fidelity arcs). This is the exact shape that will be used for PDK generation and fabrication.

---

## 1. Fan-Out (Negotiated Congestion)
Demonstrates the Negotiated Congestion algorithm handling multiple intersecting nets. The router iteratively increases penalties for overlaps until a collision-free solution is found. This example shows a bundle of nets fanning out through a narrow bottleneck.

![Fan-Out Routing](07_large_scale_routing.png)

## 2. Custom Bend Geometry Models
`inire` supports multiple collision models for bends, allowing a trade-off between search speed and geometric accuracy:
*   **Arc**: High-fidelity geometry (Highest accuracy).
*   **BBox**: Simple axis-aligned bounding box (Fastest search).
*   **Clipped BBox**: A balanced model that clips the corners of the AABB to better fit the arc (Optimal performance).

![Custom Bend Geometry](08_custom_bend_geometry.png)

## 3. Unroutable Nets & Best-Effort Display
When a net is physically blocked or exceeds the node limit, the router returns the "best-effort" partial path—the path that reached the point closest to the target according to the heuristic. This is critical for debugging design constraints.

![Best Effort Display](09_unroutable_best_effort.png)

## 4. Orientation Stress Test
Demonstrates the router's ability to handle complex orientation requirements, including U-turns, 90-degree flips, and loops.

![Orientation Stress Test](05_orientation_stress.png)

## 5. Tiered Fidelity & Lazy Dilation
Our architecture leverages two key optimizations for high-performance routing:
1.  **Tiered Fidelity**: Initial routing passes use fast `clipped_bbox` proxies. If collisions are found, the system automatically escalates to high-fidelity `arc` geometry for the affected regions.
2.  **Lazy Dilation**: Geometric buffering (dilation) is deferred until a collision check is strictly necessary, avoiding thousands of redundant `buffer()` and `translate()` calls.
