mesh.booleanIntersection

The part of space inside both closed meshes, by the kernel’s exact boolean.

GeometricSince 0.3.0

Usage

TypeScript
Mesh.booleanIntersection(a: Mesh, b: Mesh): Result<Mesh>

Parameters

  • aMesh

    A closed, edge-manifold mesh.

    Required

  • bMesh

    A closed, edge-manifold mesh.

    Required

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

TypeScript
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

See also