Skip to main content
Manifold is the default InvariantCAD backend. InvariantCAD bundles the pinned standalone Manifold 3.5.1 core JavaScript and WebAssembly runtime, without its unrelated glTF/image toolchain.

Create directly

Calling createEvaluator() without a kernel performs the same selection.

Custom WASM URL

The runtime is initialized once per JavaScript realm (a page, worker, or Node.js process). The first successful initialization fixes the configured location: later calls without a URL reuse it, and a later call with a different explicit URL fails because two incompatible global module instances would make ownership unclear. Supply wasmUrl on the first initialization in each realm; an explicit URL after a default initialization also fails. A failed initialization, such as a missing asset or a network error, is not cached, so a later call can retry with the same or a corrected URL.

Capabilities

The 0.2 adapter supports:
  • box, cylinder/cone, and sphere primitives
  • extrude and revolve
  • union, subtraction, and intersection
  • translation, rotation, scale, and mirror
  • twist/top-scale extrusion
  • mesh extraction, native measurements, and exact per-component mesh genus
  • binary/ASCII STL and OBJ through shared exporters
It does not advertise exact B-Rep, native STEP/BREP, semantic topology snapshots, exact fillets/chamfers/shells/offsets, lofts, or path sweeps. Extrude and revolve profiles must stay within ±10,000,000,000 mm (1e10) of the sketch origin in both sketch axes. Manifold’s 2D polygon engine stores coordinates as scaled 64-bit integers and fails just above 2^34 mm, so a larger profile fails before any native work with a KERNEL_ERROR that names the ceiling. The exact OCCT kernel has no such ceiling for ordinary extents.

Precision model

Manifold computes robust solids internally, but its public mesh carries Float32 vertex positions. Measurement methods call native Manifold volume, surface-area, bounding-box, and tolerance functions. The center of mass and inertia tensor come from integrating the Float32 mesh about its bounding-box center and rescaling to the native volume. That integration is accepted only when its volume matches the native volume within a bound that includes Float32 rounding of the recentered positions, so slender, thin-walled, or widely separated geometry measures normally, and tensor precision is limited by Float32 coordinates relative to the whole shape’s bounding box. Genus is evaluated on every fresh component returned by decompose(), validated as a nonnegative safe integer, safe-summed, and cleaned up transactionally. That claim is exact for the Manifold mesh representation, not an assertion about a source B-Rep. A public mesh round-trip is not a lossless native shape codec. InvariantCAD therefore does not advertise shape-artifact persistence for Manifold 3.5.1.

Resource ownership

Each adapter shape wraps its own native Manifold object, and every kernel call returns a fresh shape that the caller disposes independently, including transform with an empty operation list. Feature intermediates and evaluated output shapes are deleted by the owning evaluation. A kernel instance accepts only shapes it created: passing a shape from another createManifoldKernel() instance throws a TypeError and leaves the shape with its owner. Disposing the kernel releases every remaining live adapter shape; if a native release fails, the others are still released before the error is rethrown. A successfully initialized Manifold module remains cached for the lifetime of the JavaScript realm; a failed initialization is discarded.

Security and provenance

The bundled runtime bytes are pinned by SHA-256, verified during every build, and shipped with Manifold and embedded-component license notices. This avoids installing Manifold’s optional glTF/image dependency graph in consumers while preserving the exact tested core runtime. See third-party notices.