Expand description
The wire router: an orthogonal, channel-based path finder over the same integer lattice the document stores geometry on.
Blocked rectangles and routing channels are declared into a
RouterNGBuilder, which builds the channel graph once and freezes it into
a ClosedRouter. Routing a leg then only reweights existing edges, so a
whole frame’s routes share one graph.
The lattice is blockworx_geom::grid’s: a point::Point converts to and
from blockworx_geom::Pos2 through the same rounding the document’s
grid↔world bridge uses, and directly to and from
blockworx_doc::geometry::GridPoint, which is already lattice-aligned.
Modules§
- block
- channel
- coord
- The routing lattice’s per-axis coordinates. The grid is double-ended, so a
coordinate is signed; the two axes are separate types so a
CoordXcannot be handed to something expecting a row. - cost
- event
- point
- segment
- turtle
Structs§
- Block
Axis 🔒Index - A per-axis index of the (immutable) block set, so channel seeding iterates only
the blocks that intersect a query coordinate instead of scanning them all. Built
once when the closed geometry is assembled.
by_y[y]lists the blocks whose vertical extent (expanded by one, matchingRouterNG::seed_horiz_channel) containsy;by_x[x]the blocks whose horizontal extent (expanded by one) containsx. Same coordinate-keyedBTreeMap<Coord, Vec<_>>shape as the segment maps. - Bounds
- The rectangle a lattice covers.
- Closed
Router - A
RouterNGwhose geometry has been built and frozen: it exposes routing and in-place edge-weight mutation, but no method to add segments/channels or rebuild the graph. Occupancy of a completed route is applied by addingWIRE_COSTto the existing graph edges the wire covers, so no rebuild is needed (see Finding 1 in TUNING.md). - Fingerprint
- A lattice in a form two routers can be compared by. See
ClosedRouter::fingerprint. - Leg
- One leg as routed: its points, the direction it arrives in, and whether the lattice held a path for it.
- Opening
- A closed lattice being added to. Mirrors
RouterNGBuilder’s vocabulary, because what it records are the same requests. - Requests 🔒
- What a lattice was asked for, as asked rather than as resolved.
- RouterNG
- RouterNG
Builder - Search
State 🔒
Enums§
- Direction
- Resolution
- Whether a leg found a path through the lattice, or fell back to an L that ignores it — which may run straight through a block.
Constants§
Functions§
- collect_
intersections 🔒 - Every crossing of a horizontal segment by a vertical one, by a line sweep in
x: each horizontal segment contributes an Enter and an Exit event at its ends, each vertical segment a Scan event at itsx, and a Scan reports the horizontal segments active at that moment whoseyfalls inside its span. - cross_
cost 🔒 - direction_
between - The cardinal direction of travel from
fromtoto, orNoneif the points coincide. GreateryisSouth, matching the successor walk the search itself uses. - interval_
overlap 🔒 - normalize_
collinear_ 🔒segments - scan_
disjoint_ 🔒segments - turn_
cost 🔒