mesh.booleanIntersection
The part of space inside both closed meshes, by the kernel’s exact boolean.
Usage
Mesh.booleanIntersection(a: Mesh, b: Mesh): Result<Mesh>Parameters
aMeshA closed, edge-manifold mesh.
bMeshA closed, edge-manifold mesh.
Returns
Ok with a closed, edge-manifold mesh, which has no faces when the solids do not overlap.
Errors
Guarantees
- the result validate()s or has no faces
- volume(result) ≤ min(volume(a), volume(b))
- The same result on every machine.
Example
const a = Mesh.box().value, b = Mesh.box(Vector3.of(1, 1, 1), Point3.of(0.5, 0, 0)).value
const r = Mesh.booleanIntersection(a, b) // → volume 0.5 once loadGeometryKernel() has run