MeshVolumeMoments

Calculates the volume moments of inertia of a closed mesh object.  For more information, see the Rhino help file for "Mass Properties Calculation Details."

Syntax

Rhino.MeshVolumeMoments (strObject)

Parameters

strObject

Required.  String.  The object's identifier.

Returns

Array

An array of volume moments of inertia information if successful.  The array will contain the following information:

Element

Type

Description

0

Array (X,Y,Z)

First Moments.

1

Array (X,Y,Z)

The absolute (+/-) error bound for the First Moments.

2

Array (X,Y,Z)

Second Moments.

3

Array (X,Y,Z)

The absolute (+/-) error bound for the Second Moments.

4

Array (X,Y,Z)

Product Moments.

5

Array (X,Y,Z)

The absolute (+/-) error bound for the Product Moments.

6

Array (X,Y,Z) 

Volume Moments of Inertia about the World Coordinate Axes.

7

Array (X,Y,Z)

The absolute (+/-) error bound for the Volume Moments of Inertia about World Coordinate Axes.

8

Array (X,Y,Z)

Volume Radii of Gyration about the World Coordinate Axes.

9

Array (X,Y,Z)

The absolute (+/-) error bound for the Volume Radii of Gyration about World Coordinate Axes.

10

Array (X,Y,Z)

Volume Moments of Inertia about the Centroid Coordinate Axes.

11

Array (X,Y,Z)

The absolute (+/-) error bound for the Volume Moments of Inertia about the Centroid Coordinate Axes.

12

Array (X,Y,Z)

Volume Radii of Gyration about the Centroid Coordinate Axes.

13

Array (X,Y,Z)

The absolute (+/-) error bound for the Volume Radii of Gyration about the Centroid Coordinate Axes.

14

Array (X,Y,Z)

Volume Principal Moments of Inertia about Centroid and Principal Axes

15

Array (X,Y,Z)

The X direction of the Volume Principal Moments of Inertia about Centroid and Principal Axes.

16

Array (X,Y,Z)

The Y direction of the Volume Principal Moments of Inertia about Centroid and Principal Axes.

17

Array (X,Y,Z)

The Z direction of the Volume Principal Moments of Inertia about Centroid and Principal Axes.

Null

If not successful, or on error.

Example

Const rhObjectMesh = 32

Dim strObject, arrMP

strObject = Rhino.GetObject("Select a mesh", rhObjectPolySurface)

If Rhino.IsMeshClosed(strObject) Then

  arrMP = Rhino.MeshVolumeMoments(strObject)

  If IsArray(arrMP) Then

    Rhino.Print "Volume Moments of Inertia about the World Coordinate Axes: " & Rhino.Pt2Str(arrMP(6), 4)

  End If

End If

Also See

MeshVolume

MeshVolumeCentroid