CurveAreaCentroid

Returns that area centroid of closed, planar curves. The results are based on the current drawing units.

Syntax

Rhino.CurveAreaCentroid (strObject)

Rhino.CurveAreaCentroid (arrObjects)

Parameters

strObject

Required.  String.  The identifier of a closed, planar curve object.

arrObjects

Required.  Array.  An array of strings containing the identifiers of one or more closed, planar curve objects.

Returns

Array

An array of area centroid information if successful.  The array will contain the following information:

Element

Type

Description

0

Array (3-D Point)

The centroid point.

1

Array (X,Y,Z)

The absolute (+/-) error bound for the area centroid.

Null

If not successful, or on error.

Example

Const rhObjectCurve = 4

Dim strObject, arrMP

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

If Not IsNull(strObject) Then

arrMP = Rhino.CurveAreaCentroid(strObject)

If IsArray(arrMP) Then

Rhino.Print "The curve area centroid is: " & Rhino.Pt2Str( arrMP(0) )

End If

End If

Also See

IsCurve

IsCurveClosed

IsCurvePlanar