mesh.booleanUnion
The union of closed meshes, by the kernel’s exact boolean.
Usage
Mesh.booleanUnion(meshes: readonly Mesh[]): Result<Mesh>Parameters
meshesreadonly Mesh[]One or more closed, edge-manifold meshes.
Returns
Ok with a closed, edge-manifold mesh; a mesh with no faces among the operands is ignored.
Errors
Guarantees
- the result validate()s
- volume(result) = Σ volumes − overlaps, exactly up to f64 rounding
- The same result on every machine.
Use instead
mesh.booleanDifference: to cut one mesh out of another
Example
const a = Mesh.box().value, b = Mesh.box(Vector3.of(1, 1, 1), Point3.of(0.5, 0, 0)).value
const r = Mesh.booleanUnion([a, b]) // → volume 1.5 once loadGeometryKernel() has run