Calculates the volume centroid of closed surface or polysurface objects.
rhinoscriptsyntax.SurfaceVolumeCentroid (object_id)
rhinoscript.surface.SurfaceVolumeCentroid (object_id)
object_id |
Required. String or Guid. The object's identifier. |
List |
A list of volume centroid information if successful. The list will contain the following information:
|
|||||||||
None |
If not successful, or on error. |
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] )