Bug: Intersections.CurveLine sometimes returns null in Rhino 7 SR19

Rhino.Geometry.Intersect.Intersections.CurveLine returns null when the input is a PolylineCurve from points (32.50, 27.00, 0.00), (34.50, 27.00, 0.00), (34.50, 28.00, 0.00), (32.50, 28.00, 0.00), (32.50, 27.00, 0.00), a Line from 33.00, 30.00, 0.00 to 27.00, 30.00, 0.00, and both tolerance input values are RhinoMath.DefaultDistanceToleranceMillimeters * 0.01.

Is there a different way to intersect PolylineCurves with infinite lines?

If not, what is the fastest way to revert to the previous service release? I really need this to work as before ASAP.

Hi @Not_Necessarily,

If you add your geometry, you can clearly see that they do not intersect.

import Rhino
import scriptcontext as sc

def test():
    points = []
    points.append(Rhino.Geometry.Point3d(32.50, 27.00, 0.00))
    points.append(Rhino.Geometry.Point3d(34.50, 27.00, 0.00))
    points.append(Rhino.Geometry.Point3d(34.50, 28.00, 0.00))
    points.append(Rhino.Geometry.Point3d(32.50, 28.00, 0.00))
    points.append(Rhino.Geometry.Point3d(32.50, 27.00, 0.00))
    curve = Rhino.Geometry.PolylineCurve(points)
    sc.doc.Objects.AddCurve(curve)
    
    start = Rhino.Geometry.Point3d(33.00, 30.00, 0.00)
    end = Rhino.Geometry.Point3d(27.00, 30.00, 0.00)
    line = Rhino.Geometry.Line(start, end)
    sc.doc.Objects.AddLine(line)
    
    tol = sc.doc.ModelAbsoluteTolerance
    ccx = Rhino.Geometry.Intersect.Intersection.CurveLine(curve, line, tol, tol)
    if ccx:
        print("{0} intersections(s) found".format(ccx.Count))
    else:
        print("No intesectons found")
    
    sc.doc.Views.Redraw()
    
test()

Or am I missing something?

– Dale

Hi Dale,

I forgot to mention that it’s a regression. Previously, CurveLine would simply return an empty collection when no intersection existed, but now it returns null. A null check will obviously solve the problem, but since it’s a regression, it may be just the tip of the iceberg. This is the first time I’ve encountered a null in Rhinocommon.

Also, how can I uninstall the latest update, in case a more serious regression occurs?

Hi @Not_Necessarily,

Yes I see that. I’ve logged the issue.

https://mcneel.myjetbrains.com/youtrack/issue/RH-69329

I’ll see that a fix is pushed in for next week’s Rhino 7 SR20 RC.

Thanks,

– Dale

1 Like

Great, thanks.

RH-69329 is fixed in Rhino 7 Service Release 20