This is an odd one. In the file below, there is one contour curve, which is supposedly planar and at a plane level of +62mm. However SelPlanarCrv does not select it.
NonPlanarPlanar.3dm (26.3 KB)
I tried to figure out where it’s out of plane. At first I had a hard time finding anything. I then ran the following script on the curve:
import rhinoscriptsyntax as rs
crv=rs.GetObject("Select curve",4,preselect=True)
if crv:
pts=rs.CurvePoints(crv)
for pt in pts: print pt.Z
The result was this:
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0000000000
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
62.0
So, somewhere in the middle - from point #25 to point #41, the printout is different, and I suspected floating point “fuzz”. So then I modified the print line in the script to force more decimals:
import rhinoscriptsyntax as rs
crv=rs.GetObject("Select curve",4,preselect=True)
if crv:
pts=rs.CurvePoints(crv)
for pt in pts: print "{:.12f}".format(pt.Z)
And sure enough, then it showed up:
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
61.999999999999
61.999999999998
61.999999999998
61.999999999998
61.999999999998
61.999999999997
61.999999999998
61.999999999998
61.999999999998
61.999999999998
61.999999999998
61.999999999998
61.999999999998
61.999999999998
61.999999999998
61.999999999998
61.999999999999
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
62.000000000000
So we’re off by max 0.000000000003 That’s really wrong. Hence the word “bug” in the title.
What’s also odd about this curve is that when you turn on control points, you get 42 points indicated. If you ExtractPt, you get 58, including 16 dupes. What’s going on there? The offending segments are listed as “Elliptical arcs”. But even after simplifying the curve, which substitutes normal arcs, the curve still does not select as planar and I still get a difference in number between PointsOn and ExtractPt…