Every route order (store index) passing through one crossing point on each
axis. The set sizes both count the routes at the point and identify them, so
a 1/1 site is a lone H×V pair and anything busier is a multi-crossing.
A wire as the layers below the document read it: the authored route
with the labels hanging off it, which are entities of their own — the
bundling twin of BlockShape’s pins. Resolved once per borrow, so a
renderer, a hit test, and a relayout cannot disagree about which
labels a wire carries.
Pure geometry core of crossing detection (no Block/Store dependency so
it can be unit-tested directly). Returns, per route store-order index, the
hops that route should draw. A hop is recorded only for a strict interior
crossing of a horizontal and a vertical segment (so shared endpoints,
corners and T-junctions never hop).
Solve the router’s point list into edge geometry: axis-aligned edges
merged while collinear within one segment (two edges from different
waypoint legs never merge, even collinear), endpoints from the first
and last point.
The label whose drawn box contains hover_pos. name is the wire’s own
name — an unnamed wire measures its faint placeholder instead, so the
prompt stays clickable (matching what the renderer draws there).
Which corner of a route sits within tolerance of pos — the grab a
route edit starts from. Waypoints are positional, so the answer is the
ordinal the edit session and the emitters both speak.
Each label’s current world position, captured before a relayout so
reanchored can put it back where it was instead of letting it slide
with the arc length.
Each captured anchor re-projected onto the current geometry — the
arc lengths a route edit commits. Re-projecting the same screen point
keeps a horizontal label at the same X and a vertical one at the same Y
(the perpendicular foot shares that coordinate).
Non-destructive drag preview: reroute as if every stored waypoint were
shifted by waypoint_delta grid cells, WITHOUT mutating the stored
waypoints (the group drag is uncommitted). Only geometry’s edges and
endpoints are rewritten, and the authored route is untouched.
Routes on a frozen ClosedRouter.
Non-destructive closed-router reroute: route through the stored waypoint
skeleton minus excluded (a trim or prune the preview previews without
applying — see PreviewExclusions in the routing module), additionally
skipping inaccessible and position-duplicated corners on a working copy.
The authored route is never touched (locks included: they only matter to
commit-time trims, never to routing). Replaces geometry wholesale and
applies the new edges’ occupancy to the router in place.
The hops each of routes draws, in the order given. Each crossing point
resolves to a single orientation and every route crossing it in that
orientation gets a matching hop (see compute_crossings).
A wire’s name labels as the geometry layer reads them: the entity to
write back to, and the arc length along the solved polyline it sits at.
Resolved through the route index in the document’s one draw order, so
hit-testing, rendering, and re-anchoring all walk the same list.