SurfaceAreaCentroid

Calculates the area centroid of a surface or polysurface object.

Syntax

Rhino.SurfaceAreaCentroid (strObject [, intFaceIndex])

Parameters

strObject

Required.  String.  The object's identifier.

intFaceIndex

Optional.  Number.  If the object is a polysurface, then the index of the face to query.

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 rhObjectSurface = 8

Dim strObject, arrMP

strObject = Rhino.GetObject("Select a surface", rhObjectSurface)

If Not IsNull(strObject) Then

arrMP = Rhino.SurfaceAreaCentroid(strObject)

If IsArray(arrMP) Then

Rhino.AddPoint arrMP(0)

End If

End If

Also See

SurfaceArea

SurfaceAreaMoments