Click or drag to resize
DigitalRuneGeometryHelperGetVolume Method
Gets the enclosed volume of a triangle mesh.

Namespace: DigitalRune.Geometry
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
public static float GetVolume(
	this ITriangleMesh triangleMesh
)

Parameters

triangleMesh
Type: DigitalRune.Geometry.MeshesITriangleMesh
The triangle mesh.

Return Value

Type: Single
The enclosed volume of the given triangle mesh.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ITriangleMesh. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptiontriangleMesh is .
Remarks

This method assumes that the given triangle mesh is a closed mesh without holes.

Remember: To compute the volume of a scaled mesh, you can compute the volume of the unscaled mesh and multiply the result with the scaling factors:

volumescaled = volumeunscaled * scaleX * scaleY * scaleZ

See Also