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:
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))
dots=[]
rs.EnableRedraw(False)
for i in range(len(interEvent)):
point = interEvent[i].PointA
dots.append(rs.AddTextDot(str(i+1),point) )
rs.EnableRedraw(True)
rs.GetString("Press Enter when Done")
rs.DeleteObjects(dots)
else:
print "no intersections"
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.
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.
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…
Takker,
-wim