Inflation — borders, validity, and the Track result¶
inflate_warp(center, config, valid=None, count=None) is the final pipeline stage. It
composes several sub-stages to produce the complete Track named-tuple from the relaxed
centerline.
Composition¶
The function composes in order:
resample_uniform— re-uniformize the relaxed bead chain so that frame and curvature estimates are not biased by residual spacing irregularity.frame_curvature(_frame_k) — central-difference unit tangent, left-normal, and Menger curvature at each bead.Constant half-width offset —
offset(_offset_build_k+_offset_assign_k) shifts every centerline point by±walong the normal. The outer border is chosen as the larger-signed-area candidate, so the convention is consistent even for counter-clockwise layouts.validity(_validity_k) — a single per-env kernel that combines all geometric acceptance criteria (see below)._arclength_k— computes cumulative arc length along the centerline for each valid env.Returns a
Tracknamed-tuple.
The offset, validity, and arclength stages are count-aware — they operate over each env’s
count[e] real points. The fixed-N parity path is count[e] == N.
Validity gate — _validity_k¶
_validity_k is a single per-env kernel that combines the following checks:
Generation flag — all True now that generation no longer gates; validity is purely geometric.
Closed-loop turning ≈ 2π — the net turning number must be approximately one full winding.
Width floor — minimum track width must exceed the configured floor.
No NaN — all points in the env’s real-point range must be finite.
Thickness ≥
(1 − relax_tol) · half_width— the inflated road must not collapse below the required half-width (within tolerance).Border self-intersections — only when
validity_border_checkis set (default off). This check is redundant with the thickness/separation gate: a crossing or fat-band overlap drivesseparation_min → 0 → thickness < half_width → invalidanyway.
Index-aligned borders¶
The inner and outer borders returned in Track are index-aligned with the centerline:
outer[e, i], center[e, i], and inner[e, i] are all offset from the same
centerline bead i, so downstream consumers can index them identically.
Half-width recovery¶
The half-width at each bead can be recovered as
‖outer[e, i] − center[e, i]‖ = ‖center[e, i] − inner[e, i]‖ = half_width
(constant by construction, modulo floating-point rounding). The thickness validity
metric checks the minimum over all beads to ensure no inflation collapsed.
Track fields¶
Field |
Shape |
Description |
|---|---|---|
|
|
Outer border points (NaN-padded past |
|
|
Re-uniformized centerline points. |
|
|
Inner border points (NaN-padded past |
|
|
Unit tangent at each centerline bead. |
|
|
Left-normal |
|
|
Cumulative arc length at each bead (0 at bead 0). |
|
|
Total track perimeter per env. |
|
|
Boolean validity mask (all criteria above must pass). |
|
|
Number of real beads per env (padding is NaN past this index). |
|
|
Signed loop winding: |
generate() always returns the same Track instance with stable wp.array
pointers. Callers that need a snapshot should use Track.clone().