Skip to main content

curve_curve_intersect

Function curve_curve_intersect 

Source
pub fn curve_curve_intersect<S: Scalar, const D: usize, const C: usize>(
    curve_a: &NurbCurve<S, D>,
    curve_b: &NurbCurve<S, D>,
    max_solutions: usize,
    max_nodes: usize,
    min_subdivision_size: S,
) -> GeopResult<Intersections<(S, S)>>
where NurbCurve<S, D>: ParameterRefinable<S, C>,
Expand description

Points where curve_a crosses — or, overlapping along an arc, coincides with — curve_b: the drop-in counterpart of super::curve_curve_bisect::curve_curve_intersect, with the same signature and Intersections contract.

Overlaps are found directly ([curve_curve_overlaps]: ends of each curve located on the other, then one midpoint probe per candidate stretch) instead of being inferred from a search hitting max_solutions. Then:

  • no overlap: Intersections::Found with the clipping search’s crossings, at most max_solutions;
  • an overlap: Intersections::Coincident with, in this order and up to max_solutions in total, the overlaps’ end points, the isolated crossings on the rest of curve_a, and points spread evenly over the overlaps.

Exhausting max_nodes in any sub-search is an error.