Determining Curve Crossing Points
The function
ptrdiff_t CurveCurveCrossing( const MbCurve3D & curve1,
const MbCurve3D & curve2,
SArray<double> & result1,
SArray<double> & result2,
double epsilon = Math::metricRegion );
finds crossing points of two spatial curves and returns the parameters of these points on each curve. Crossing points are such points of the curves that the segment connecting these points is perpendicular to the tangents of both curves.
Function parameters:
curve1 – the first curve;
curve2 – the second curve;
result1 – parameters of crossing points on the first curve;
result2 – parameters of crossing points on the second curve;
epsilon – accuracy of solution search.
The return value is the number of found crossings.
Parameters of the found crossing points for the first curve are stored in the result1 array, and for the second curve in the result2 array. In the special case of a geometric intersection of the curves, the segment between the crossing points degenerates to zero length, and the crossing points become intersection points. In addition to proper crossings, the CurveCurveCrossing() function returns crossing points of the curves for which the segment connecting these points is perpendicular to the tangents to the curves at these points.
For example, in figure the CurveCurveCrossing() function returns four pairs of intersection parameters: on the circle curve1 they correspond to points p1, p2, p3, and p4, and on the segment curve2 to points r1, r2, r3, and r4.