Skip to main content

refine_crossing

Function refine_crossing 

Source
pub fn refine_crossing<S: Scalar, const D: usize, const C: usize>(
    curve_a: &NurbCurve<S, D>,
    curve_b: &NurbCurve<S, D>,
    t_a: S,
    t_b: S,
) -> (S, S)
where NurbCurve<S, D>: ParameterRefinable<S, C>,
Expand description

Polish one isolated (t_a, t_b) — as returned by curve_curve_intersect — by Gauss-Newton on A(t_a) - B(t_b) = 0.

Two unknowns against C equations, so this solves the normal equations (JᵀJ)δ = -JᵀF with J = [A'(t_a), -B'(t_b)]. See curve_surface::refine_crossing for why subdivision and Newton are split this way, and why this is opt-in rather than applied to everything the search returns.

Infallible by construction: anything that stops Newton — parallel tangents making JᵀJ singular, an iterate leaving a domain, a refined box disjoint from the one subdivision proved the solution lies in — returns the incoming box unchanged. Refinement can only tighten, never fail.

(The Krawczyk-verified version above this is currently disabled — see the module comment near the top of the file — so this is plain, unverified Newton, same as before that work: it tightens an already-isolated crossing but doesn’t itself certify existence/uniqueness or handle a tangential contact any better than stalling on it.)