Determine the orientation (counter-clockwise or clockwise) of a closed, planar curve.
rhinoscriptsyntax.ClosedCurveOrientation (curve_id, direction=[0,0,1])
rhinoscript.curve.ClosedCurveOrientation (curve_id, direction=[0,0,1])
curve_id |
Required. String or Guid. The object's identifier. |
direction |
Optional. List of 3 numbers or Vector3d. A 3-D vector that identifies the up, or Z axis, direction of the plane to test against. If omitted, the world Z axis (0,0,1) is used. |
1 |
The curve's orientation is counter-clockwise. |
-1 |
The curve's orientation is clockwise. |
0 |
Unable to compute the curve's orientation. |
None |
On error. |
import rhinoscriptsyntax as rs
curve = rs.GetObject("Select curve", rs.filter.curve)
if rs.IsCurveClosed(curve) and rs.IsCurvePlanar(curve):
print rs.ClosedCurveOrientation(curve)