MeshVolume

Returns the approximate volume of one or more closed mesh objects.

Syntax

rhinoscriptsyntax.MeshVolume (object_ids)

rhinoscript.mesh.MeshVolume (object_ids)

Parameters

object_ids

Required.  String or Guid.  The object's identifier (or list of identifiers).

Returns

Tuple

A tupe containing three numbers if successful.  The three elements of the array are as follows:

Element

Type

Description

0

Number

The number of meshes used in the volume calculation.

1

Number

The total volume of all meshes.

2

Number

The error estimate.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select mesh", rs.filter.mesh )

if obj and rs.IsMeshClosed(obj):

    volume = rs.MeshVolume(obj)

    if volume: print "Mesh volume:", volume[1]

Also See

IsMeshClosed

MeshArea