Skip to main content

Module curve_curve

Module curve_curve 

Source
Expand description

Curve–curve intersection by per-axis fat line clipping — the design is curve_curve.md next to this file; it reuses the clip of contains/curve.md and the search schedule of contains/surface.md.

For curves A(s) = H_A / W_A and B(t) = H_B / W_B with positive weights, A_k(s) = B_k(t) iff g_k(s, t) = H_{A,k}(s) W_B(t) - W_A(s) H_{B,k}(t) = 0, a polynomial tensor-product spline in the independent parameters s, t with coefficients d_ij = P_{i,k} Q_{j,w} - P_{i,w} Q_{j,k} — no division, no degree elevation. Its zeros are clipped in both directions ([clip_tensor]), exactly as a surface’s are in contains::surface.

Assumes no coincident arcs (curve_curve.md): the result is a list of paired (s, t) boxes, and reaching some count of them means nothing.

Functions§

curve_curve_crossings
All (s, t) with curve_a(s) = curve_b(t), as paired parameter boxes (curve_curve.md), for curves that do not overlap along an arc — see curve_curve_intersect for the wrapper that handles overlaps. Breadth-first over pairs of subcurves:
curve_curve_intersect
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.
refine_crossing
Polish one isolated (t_a, t_b) — as returned by curve_curve_intersect — by Gauss-Newton on A(t_a) - B(t_b) = 0.