Usage
mesh.volume(): Result<number>
Returns
Ok with the volume in model units cubed (positive for an outward mesh).
Errors
-
Returned when the mesh has boundary edges; entities lists them.
The mesh has boundary edges (used by one face), so it is not closed. Close the boundary; volume is not reported for an open mesh.
-
Returned when an edge has more than two faces.
An edge is used by more than two faces. Separate or remove the extra faces on the listed edges.
-
Returned when neighbouring faces disagree on which way is out.
Two faces sharing an edge traverse it in the same direction. Flip the faces on one side of the listed edges.
Guarantees
- for a box, equals the product of its edge lengths
- is unchanged by a rigid transform (transformed)
- The same result on every machine.
Example
Mesh.box(Vector3.of(2, 3, 4)).value.volume()
See also