mesh.volume

The volume the mesh encloses, when it bounds a solid.

GeometricSince 0.3.0

Usage

TypeScript
mesh.volume(): Result<number>

Returns

Ok with the volume in model units cubed (positive for an outward mesh).

Errors

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

TypeScript
Mesh.box(Vector3.of(2, 3, 4)).value.volume() // → { ok: true, value: 24, … }

See also