Continuous Frenet-based frame along a Curve.
Algorithm (pinned by the audited plan, refined per the final audit):
- Frenet frame from exact derivatives (t = v/|v|, b = v x a/|v x a|,
n = b x t) wherever kappa >= KAPPA_TOL.
- Reference-up fallback where kappa < KAPPA_TOL (straight segments), with
hysteresis so the frame does not chatter at the threshold. The
Frenet/fallback decision of a query point follows the nearest reference
sample, so it is piecewise constant in s.
- Sign continuity enforced against a dense precomputed reference sampling:
n and b flip together so that n stays continuous along s. NOTE: through
an inflection (kappa -> 0 crossing) this yields a CONTINUOUS frame that
is deliberately NOT the pure Frenet frame (whose normal would jump);
what raises FrameError is a rotation between adjacent samples that stays
above MAX_STEP_ROTATION even after adaptive resampling — i.e. a genuine
kink, not a smooth inflection.