Skip to main content

Module curve

Module curve 

Source
Expand description

Curve/point containment by per-axis fat line clipping — the derivation is in curve.md next to this file; this module implements its Clip B (“fat line”) together with the iteration of its section 5.

The result is a sound enclosure of every parameter at which the curve could pass through the point, None when it definitely doesn’t. Instead of only asking “could this segment contain the point?” and bisecting, every segment is clipped: each Cartesian axis k yields a scalar spline g_k(t) = X_k(t) - p_k W(t) whose zeros are exactly the parameters where that coordinate matches, and a fat line around its graph’s control polygon bounds those zeros to an interval. Intersecting the axes’ intervals shrinks the segment directly towards the solution, so a transversal hit converges in a handful of clips instead of one bisection per bit of precision.

Functions§

curve_could_contain
Every parameter at which curve could pass through point: the Scalar::union of every converged segment’s clipped parameter interval, exploring breadth-first up to max_nodes segments. None only when every part of the domain was rejected: running out of budget is never read as “not contained” (nor as “contained”) — it is an error, since the search is incomplete (see surface.md §5).