ClosedCurveOrientation

Determine the orientation (counter-clockwise or clockwise) of a closed, planar curve.

Syntax

Rhino.ClosedCurveOrientation (strObject [, arrDirection])

Rhino.ClosedCurveOrientation (strObject [, arrXform])

Parameters

strObject

Required.  String.  The identifier of a simple (no self-intersections) closed planar curve object.

arrDirection

Optional.  Array.  A 3-D vector that identifies the up, or Z axis, direction of the plane to test against.  This plane will be used to map (orient) the curve to the world x-y plane.  If omitted, the curve is assumed to be parallel with the world x-y plane.

arrXform

Optional.  Array.  A transformation matrix (4x4 array of numbers) used to map (orient) the curve to the world x-y plane.  If omitted, the curve is assumed to be parallel with the world x-y plane.

Returns

+1

The curve's orientation is counter-clockwise in the world x-y plane.

-1

The curve's orientation is clockwise in the world x-y plane.

0

Unable to compute the curve's orientation.

Null

On error.

Example

Const rhObjectCurve = 4

Dim strObject

strObject = Rhino.GetObject("Select curve", rhObjectCurve)

If Rhino.IsCurveClosed(strObject) And Rhino.IsCurvePlanar(strObject) Then

Rhino.Print Rhino.ClosedCurveOrientation(strObject)

End If

Also See

IsCurveClosed

IsCurvePlanar