Overview
OpenGeometry exposes kernel-backed boolean operations that work on B-Rep payloads. The helpers accept multiple operand formats (wrapper objects, raw B-Rep objects, or serialized JSON) and return a renderableTHREE.Mesh result with access to the output B-Rep and a structured report.
To learn how booleans work and what to expect from them, read Booleans.
Initialization
Initialize the WASM module once before calling any boolean helpers:API
booleanUnion
booleanIntersection
booleanSubtraction
BooleanOperand
Each boolean helper accepts aBooleanOperand in any of these forms:
- A serialized B-Rep JSON string
- A parsed B-Rep object (the helper will
JSON.stringify(...)it) - A wrapper object that exposes one of these methods:
getBrepSerialized(): stringgetBrepData(): unknowngetBrep(): unknown
Cuboid and Opening) directly.
BooleanExecutionOptions
Boolean options let you tune both kernel behavior and rendering. Kernel optionsNumeric tolerance used by the kernel for boolean decisions.
When enabled, the kernel attempts to merge coplanar faces in the output.
Output mesh color (hex).
Enable outline rendering for the result. The helpers default to
true when omitted.Use wide outlines backed by Three.js
LineSegments2 (instead of thin LineSegments).Outline width for fat outlines. Values are sanitized and must be finite and greater than zero.
Return type: BooleanResult
All boolean helpers return aBooleanResult, which extends THREE.Mesh.
Common fields and methods
Parsed report emitted by the kernel (operation name, input/output counts, empty flag, and more).
Returns the parsed output B-Rep object.
Returns the output B-Rep JSON string (useful for export and persistence).
Enables or disables outline rendering for the result mesh.
Toggles wide outline rendering.
Sets the outline width used for fat outlines.
Disposes the result mesh geometry and materials (call this when you remove the mesh from your scene).
Examples
Cut a cuboid with an opening
UseOpening.subtractFrom(...) when you want the opening to be the cutting operand:
Union and intersection
Related
Live Demo
Boolean Operations Demo
Try Boolean operations in the browser

