Skip to main content

Module curve_surface

Module curve_surface 

Source
Expand description

Curve–surface intersection by per-axis fat line clipping — the design is curve_surface.md next to this file; it is curve_curve with one more parameter.

For a curve C = H_C / W_C and a surface Scalar = H_S / W_S with positive weights, C_k(t) = S_k(u, v) iff g_k(t, u, v) = H_{C,k}(t) W_S(u, v) - W_C(t) H_{Scalar,k}(u, v) = 0, a polynomial tensor-product spline in three independent parameters with coefficients d_ijl = P_{i,k} Q_{jl,w} - P_{i,w} Q_{jl,k}. Its zeros are clipped in all three directions ([clip_tensor]) — nine clips per box.

Assumes no arc of the curve lies on the surface (curve_surface.md): the result is a list of paired (t, (u, v)) boxes, and reaching some count of them means nothing. Works on the untrimmed patch.

Functions§

crossing_points
Every point where curve crosses surface, each refined (refine_crossing) and with where it is on the surface: what the curve and the surface give there intersected, both enclosures of one point — at a pole, where the collapsed parameter says nothing, the pole. A curve lying on the surface along an arc is refused: where it meets the surface is no point.
curve_surface_crossings
All (t, (u, v)) with curve(t) = surface(u, v), as paired parameter boxes (curve_surface.md), for a curve with no arc lying on the surface — see curve_surface_intersect for the wrapper that handles that. The same search as curve_curve::curve_curve_crossings, over (curve segment, patch) pairs with three parameter directions: AABB and [clip] rejection, a pinned parameter handed down one dimension ([solve_pinned]), restriction while the clip keeps shrinking the pair ([crate::fat_line::restriction]), and once it stalls, convergence when both objects’ extents are within min_subdivision_size or fair bisection otherwise ([crate::fat_line::stalled]).
curve_surface_intersect
Points where curve crosses — or, lying on it along an arc, coincides with — surface, under the Intersections contract.
curve_surface_overlaps
Every stretch of curve lying on surface (see [coincidence]), or — for a reach above zero — running within reach of it along every axis, with the surface parameters as the partner (see curve_curve::curve_curve_overlaps_and_crossings on reach): the stretches lying on the surface widened by reach (NurbSurface::widen), its boundary curves with it. Candidates are the curve’s ends found on the surface, and where the curve meets the patch’s four boundary curves — through curve_curve::curve_curve_overlaps_and_crossings, so a curve running along a boundary contributes that stretch’s ends. A boundary that isn’t clamped (so its control row isn’t the surface there) contributes no candidates.
refine_crossing
Polish one isolated (t, uv) — as returned by curve_surface_intersect — by Newton on C(t) - Scalar(u, v) = 0, three equations in the three unknowns t, u, v (newton::refine).