Skip to main content
createEvaluator() creates the orchestration layer that validates documents, resolves expressions, solves sketches, calls a geometry kernel, and exposes owned outputs.

Create an evaluator

The default preserves the original behavior: it uses the bundled Manifold kernel and built-in reference sketch solver. Named profiles add a complete creation-time runtime gate:
mesh-preview creates Manifold and requires its common mesh-modeling baseline. mechanical-exact creates stock OCCT and requires exact B-Rep, the common exact feature set, STEP/BREP import and export, and face/edge/vertex topology. A supplied custom kernel is checked against the same profile before an evaluator is returned. Use inspectEvaluatorProfile(kernel, profile) when an application needs to show missing capabilities without attempting evaluator creation. The returned report is immutable and contains stable capability paths. Both kernel and solver boundaries can still be replaced:
If you supply a kernel or solver, the evaluator takes ownership of it and disposes it when evaluator.dispose() is called. If a supplied kernel fails profile preflight, no evaluator takes ownership and the caller remains responsible for disposing that kernel. A profile-created kernel is disposed automatically if creation fails.

Evaluation options

Unknown output, parameter, or configuration IDs produce diagnostics. Duplicate output names in the option array are normalized rather than evaluated twice.

Result handling

Evaluation returns a discriminated CadResult:
Warnings may accompany a successful result. For example, a BOM can be valid while warning that a part number or material label is missing.

Output classes

EvaluatedDesign.output(name) returns one of:
  • EvaluatedSolid
  • EvaluatedPart
  • EvaluatedAssembly
Solids provide mesh, measure, topology, and export. Parts add material, physical mass, and single-item BOM behavior. Assemblies expose occurrences, aggregate geometry, physical properties, and nested BOM rollups.

Ownership and disposal

An evaluation may allocate many native intermediate shapes. The successful EvaluatedDesign owns all shapes retained for its outputs. Dispose the design, not individual outputs.
Use try/finally; do not rely on garbage collection to release WASM memory.

Cancellation

Pass an AbortSignal for long operations. The evaluator checks cancellation between bounded stages and forwards it to protocols that support asynchronous work. Some same-thread synchronous native WASM calls cannot be interrupted in the middle of one call; cancellation is observed at the next boundary. For hard latency isolation, run evaluation in a worker or separate process that the host can terminate. See browser and workers.

Reuse

An evaluator can process multiple documents and variants sequentially. Results remain independently owned and must each be disposed. Kernel runtime module initialization may be shared internally, but shape ownership is never shared implicitly across evaluated designs.