createEvaluator() creates the orchestration layer that validates documents,
resolves expressions, solves sketches, calls a geometry kernel, and exposes
owned outputs.
Create an evaluator
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:
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 discriminatedCadResult:
Output classes
EvaluatedDesign.output(name) returns one of:
EvaluatedSolidEvaluatedPartEvaluatedAssembly
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 successfulEvaluatedDesign owns all shapes retained for its outputs. Dispose the design,
not individual outputs.
try/finally; do not rely on garbage collection to release WASM memory.
Cancellation
Pass anAbortSignal 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.