Skip to main content

intersect_surfaces_supplemental

Function intersect_surfaces_supplemental 

Source
pub fn intersect_surfaces_supplemental(
    first_surface: &NurbsSurface,
    second_surface: &NurbsSurface,
    options: &SurfaceIntersectionOptions,
) -> Result<Vec<SurfaceIntersectionCurve>, String>
Expand description

Gated supplemental SSI detector for a pair the coarse pair-classifier culled as “tangential-only” (NearTangent + tangential_only).

The 5×5 classification grid can land only on an incidental tangential KISS between two curved carriers (e.g. the inner walls / tube tops of two overlapping tori) and never sample the transverse loop where their tubes actually CROSS, so tangential_only is a false positive that would drop a real intersection. This routine re-seeds a DENSER grid on BOTH carriers, keeps only transverse seeds (near-parallel normals rejected up front, so the tangency band is never walked), SWALLOWS per-branch trace-exhaustion (a genuine tangency band never closes/exits and would otherwise error — here it simply means “no transverse curve from this seed”), and returns only branches that are genuinely transverse along their length.

A genuinely tangential pair yields an empty result (every seed rejected / every trace fruitless), so the caller skips exactly as before — the common intersection path is never touched.

NOTE — deferred capability: when this DOES return branches, the true intersection is singular (the transverse loops meet at tangent nodes, e.g. equal-radius torus-torus at (1.5, ±3.708, ±1.5)). Imprinting them requires 4-valent tangent-vertex (“checkerboard”) singular assembly, which the kernel does not yet do; until then the caller REFUSES such a pair with a clear error rather than silently dropping the geometry or emitting the cryptic downstream pcurve/open-loop error. See imprint.rs (tangential-only skip) and the project singular-assembly roadmap.