Stefano.3dm (14.6 KB)
So I attached the .3dm file for the 2 curves in question. Just to summarize, the first curve is a simple line segment in the x direction (a 2 point degree 1 nurbs aligned exactly in the x-direction). And an 90 arc curve that almost forms a perfect tangent continuous join to the line curve. The “imperfection” is a mismatch between the start of the 2 curves on the order of 10^-14.
I agree that the intersection results differ between Rhino 5 and Rhino 7. In fact I have been working on this code lately and in the Rhino 8 WIP the results go back to the Rhino 5 results.
I’ll try to give a high level view of Curve-x-Curve intersector(CCX). Focusing on the what the results mean and how tolerance parameters are used. The function Rhino.Geometry.Intersect.Intersection.CurveCurve is a computer function with inputs of parameters and data structures and and outputs of other data structures. Its complete description would involve tolerance parameters, Nurbs curve definitions, IEEE floating point computation and other implementation details. However, the model of what is supposed to happen is 3d geometry of piecewise smooth curves ( A polyline is not smooth, it may have kinks, but the pieces between the kinks are smooth line segments).
Given a pair of curves in 3d geometry an intersection point is a 3d point that is common to both curves. These points come in two types. An isolated intersection point has a region around it that contains no other intersection points. The ccx-point type intersection event from CCX is modeled on these isolated intersection points. Other intersection points are not isolated but are contained in curves of intersection points. For example consider two arcs of the unit circle, one a semi-circle consisting of angles 0 through 180 degrees and the other a 90 degree arc of the same circle with angles -45 degrees to 45 degrees. These arcs overlap in a 45 degree arc. A ccx-overlap event from CCX is modeling this type of an intersection event.
Overlap.3dm (21.9 KB)
Intersections in Rhino are tolerant of slight imperfections of the input data. The intersection tolerance specifies how close curves must be for the intersector to consider the curves intersect. For example a pair of skew lines in 3d do not intersect in real geometry. They do have a unique pair of points that achieve the minimum distance between the curves. When these curves are intersected with CCX if that distance is less than intersection tolerance a ccx-point event is reported. This tolerance is also used for tangent intersections and endpoint intersections.
There is also an overlap tolerance. The default overlap tolerance is double the intersection tolerance, this can be achieved by setting overlap tolerance = 0.0.
The overlap tolerance specifies the maximum allowed deviation to still be considered an overlap. overlaps start and end at points that would otherwise be ccx_point events.
There are some other special cases. In particular there is no minimum overlap length, but this can easily be tested by the user when processing ccx-overlap events.
In the 8.0 WIP I am eliminating super small overlaps like the one you reported using ON_PointsAreCoincident which tests that points are within an absolute distance of ~2e-10 or relative tolerance of ~2^-13. This will take care of small rounding errors without sacrificing much accuracy. Small overlaps can happen and when constructing high quality curves, for example in curve joining, one needs to know where the overlaps are.
For this reason I cannot just ignore overlaps smaller than intersection tolerance. Although in some application that may be completely appropriate.