Skip to main content

surface_could_contain

Function surface_could_contain 

Source
pub fn surface_could_contain<S: Scalar>(
    surface: &NurbSurface<S, 4>,
    point: &Vector3<S>,
    max_nodes: usize,
    min_subdivision_size: S,
) -> GeopResult<Option<(S, S)>>
Expand description

Fat-line-clipping counterpart of super::surface_bisect::surface_could_contain (surface.md §§4–5), with the same tunables: the componentwise union of every converged patch’s clipped (u, v) box, exploring breadth-first.

Per patch:

  • the cached AABB and the [clip] are necessary conditions — failing either rejects the patch;
  • it converges once its extent along both directions (control-polygon lengths, which bound a folded patch where corner chords don’t; see [crate::fat_line::converged]) is within min_subdivision_size, and then — the other existing necessary condition — its convex hull must still could-contain the point, or it is rejected;
  • if a direction collapsed onto a clamped domain end, the boundary row is searched with curve_could_contain;
  • otherwise it is restricted to the clip or bisected per [crate::fat_line::plan] (the spatially longest direction) — after a restriction, narrowing v tightens the next u projection and vice versa.

None means every part of the domain was rejected. Running out of max_nodes is never read as “not contained” (nor as “contained”): it is an error, since the search is incomplete. The boundary curve search gets the remaining budget as its own.