| GeometryHelperGetVolume Method |
Gets the enclosed volume of a triangle mesh.
Namespace: DigitalRune.GeometryAssembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax public static float GetVolume(
this ITriangleMesh triangleMesh
)
<ExtensionAttribute>
Public Shared Function GetVolume (
triangleMesh As ITriangleMesh
) As Single
public:
[ExtensionAttribute]
static float GetVolume(
ITriangleMesh^ triangleMesh
)
[<ExtensionAttribute>]
static member GetVolume :
triangleMesh : ITriangleMesh -> float32
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 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