mesh.box
An axis-aligned box of eight points and six outward quads.
Usage
Mesh.box(size?: Vector3, center?: Point3): Result<Mesh>Parameters
sizeVector3Edge lengths along x, y and z. Default
Vector3.of(1, 1, 1). In model.centerPoint3Centre of the box. Default
Point3.origin. In model.
Returns
Ok with a closed, edge-manifold, outward box.
Errors
Guarantees
- validate() succeeds
- volume() equals size.x · size.y · size.z
- The same result on every machine.
Example
const r = Mesh.box(Vector3.of(2, 1, 1))
r.ok && r.value.volume() // → { ok: true, value: 2, … }