mesh.booleanUnion

The union of closed meshes, by the kernel’s exact boolean.

GeometricSince 0.3.0

Usage

TypeScript
Mesh.booleanUnion(meshes: readonly Mesh[]): Result<Mesh>

Parameters

  • meshesreadonly Mesh[]

    One or more closed, edge-manifold meshes.

    Required

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

Example

TypeScript
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