Overlapping curve not flagged as selfintersecting. Isn't it?

Hi @pascal shouldn’t self overlapping curves flag as selfintersecting?

If I dra a polyline that goes “back and forth” over it self then it isn’t recognized as a selfintersecting curve.
The overlap is illustrated with the exaggerated red line:

Just make one and test it with this script:

import rhinoscriptsyntax as rs
import Rhino

polyline_id = rs.GetObject()
newPoly = rs.coercegeometry(polyline_id)
interEvent = Rhino.Geometry.Intersect.Intersection.CurveSelf(newPoly.ToNurbsCurve(), 0.001);

if interEvent:
    print "Number of intersections: "+str(len(interEvent))
    for i in range(len(interEvent)):
        point = interEvent[i].PointA
        dots.append(rs.AddTextDot(str(i+1),point) )
    rs.GetString("Press Enter when Done")
    print "no intersections"

Hei Jørgen -

I would consider it a bug if that red curve was flagged as a self-intersection.
If I put one of those inside endpoints on the same line, it does become a self-intersecting curve and is flagged correctly as such.

If that is not what you are seeing, we’ll need that curve as a 3dm file.

Hi Wim, the red curve is just to indicate how the black curve goes.

Try making a polyline with X = [0,10,5,15]
(from 0,0 to 10,0 to 5,0 to 15,0 in other words back and forth in the middle).

On my hand that curve returns no intersections.

Here is a testfile and I updated the code above slightly, so it states how many intersection events it encountered.

selfintersecting.3dm (128.9 KB)

Yep, I tested this too (in V7) with an overlapping polyline and it does not get selected by SelSelfIntersectingCrv nor does IntersectSelf find any intersections.

1 Like

Thanks, Jørgen -

I see that when all 4 points are on the same line - RH-66652.
I reported that as an issue with SelSelfIntersectingCrv and possibly IntersectSelf but I see that Dale uses the CurveSelf method to test in RH-43624

1 Like