Skip to main content

curve_curve_intersect

Function curve_curve_intersect 

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

Points where curve_a crosses — or, overlapping along an arc, coincides with — curve_b, under the 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.