Yep, that does appear to be the case. @dale
https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_Geometry_CurveOrientation.htm
Maybe i am wrong on this matter, but I think this was the case in Rhino 5 and got fixed in Rhino 6 already?
No, I tested it, it’s not fixed… that is to say the documentation does not match the function returns.
Yes, you are right. The return value got swapped from Rhino 5 to 6 but apperently the return values got swapped in the Rhino 6 documentation as well. Now the return value fits with the Rhino 5 documentation.
The documentation of the rhino script syntax is still not updated correctly in Rhino 8 I have created a test file for the problem:
CurveDirection.3dm (50.4 KB)
import rhinoscriptsyntax as rs
view = rs.CurrentView()
rs.ViewCPlane( view, rs.WorldXYPlane() )
objects = rs.GetObjects(message=None, filter=4, group=True, preselect=False, select=False, objects=None, minimum_count=1, maximum_count=0, custom_filter=None)
for obj in objects:
if rs.IsCurveClosed(obj) and rs.IsCurvePlanar(obj):
if rs.ClosedCurveOrientation(obj, direction=(0,0,1)) == 1:
print("the curve's orientation is clockwise (accordingly to the rhinoscriptsyntax-documentation)")
elif rs.ClosedCurveOrientation(obj, direction=(0,0,1)) == -1:
print("the curve's orientation is counter-clockwise (accordingly to the rhinoscriptsyntax-documentation)")
else:
print("Unable to compute curve direction")
I’ve logged a ticket for this.