SurfaceVolumeCentroid

Calculates the volume centroid of closed surface or polysurface objects.

Syntax

rhinoscriptsyntax.SurfaceVolumeCentroid (object_id)

rhinoscript.surface.SurfaceVolumeCentroid (object_id)

Parameters

object_id

Required.  String or Guid.  The object's identifier.

Returns

List

A list of volume centroid information if successful.  The list will contain the following information:

Element

Type

Description

0

Point3d

The centroid point.

1

Tuple (X,Y,X)

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

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select a surface", rs.filter.polysurface)

if rs.IsPolysurfaceClosed(obj):

    massprop= rs.SurfaceVolumeCentroid(obj)

    if massprop: rs.AddPoint( massprop[0] )

Also See

SurfaceVolume

SurfaceVolumeMoments