Skip to main content

project_point_to_surface_seeded

Function project_point_to_surface_seeded 

Source
pub fn project_point_to_surface_seeded(
    surface: &NurbsSurface,
    point: Vec3,
    seed_u: f64,
    seed_v: f64,
) -> Result<SurfaceProjection, String>
Expand description

Project a point onto a surface starting Newton from an explicit (u, v) guess, WITHOUT the global grid seed. This is a footpoint refiner for continuity-preserving curve-on-surface tracing: seeding each edge sample from its neighbour’s parameters keeps the fit on ONE branch of a surface that folds back over the small trimmed patch, where an independent global search would snap to whichever fold is momentarily closest and tear the pcurve into a self-crossing zig-zag. The caller compares the returned distance against the global answer and only adopts this result when it is geometrically just as valid, so a bad seed can never make a fit worse.