createOcctKernel() adapts occt-wasm@3.8.0 to InvariantCAD’s exact geometry,
topology, and exchange protocols.
Stock runtime
null, not zero: the stock and owned facades do not expose the
degenerate-edge predicate needed to evaluate the B-Rep Euler formula correctly
for spheres, cones, seams, holes, and disconnected shells.
Load a WASM source explicitly
wasm accepts a URL, string URL/path, ArrayBuffer, or Uint8Array:
Tessellation and tolerance
mesh() and mesh exports, not the underlying B-Rep.
Do not change tolerances merely to force an invalid model through a check.
Native history limits
Owned facade operations can produce large indexed evolution reports. Bound materialization explicitly:Attested owned facade
For a reviewed bundle, prefer an environment-specific attested loader over pairing the files manually:attestedRuntime is mutually exclusive
with wasm and moduleFactory.
The opaque pair can be reused to create kernels only through the evaluated
InvariantCAD internal module instance that created it; cloning the visible
report does not reproduce executable authority. Its exact runtime-pair identity
strengthens only the repository-private artifact compatibility fingerprint; it
does not change persistent-topology fingerprints or advertise shapeArtifacts.
The separate declared-build identity records the manifest, but does not prove
that recipe ran or authenticate a publisher. See
OCCT runtime attestation for the browser
loader, Node module-hook lifecycle, CSP, failure reasons, and complete
non-claims.
Direct custom or rebuilt facade
moduleFactory plus wasm overrides remain available for an intentionally
trusted custom or rebuilt pair. They do not perform release-manifest
attestation or acquire an attested runtime-pair identity.
Exact exchange
The deterministic metadata and byte contract below is implemented for the
unreleased 0.2 line, not the current 0.1.1 npm package.
capabilities.stepExport
envelope advertises
KERNEL_STEP_EXPORT_PROTOCOL_VERSION === 1, schema AP214IS, byte scope
same-shape-representation-and-metadata, a 64 MiB output ceiling, and a
64 KiB metadata ceiling. This is a distinct, stronger declaration than
nativeExports containing "step"; the latter promises format availability,
not deterministic bytes. inspectKernelStepExportCapabilities(...) snapshots
and validates this optional envelope without invoking accessors.
Supplying wasm, moduleFactory, or attestedRuntime omits this envelope and
retains weak raw STEP export. Even an explicitly supplied stock-derived
artifact is unqualified until a separate exact-writer probe or attestation
contract exists.
At the evaluated-output boundary,
output.export("step", { metadata?, signal?, maxOutputBytes? }) supplies a
complete resolved metadata request to a supporting kernel. The qualified
bundled stock runtime writes one AP214IS product, then a purpose-built
structural Part 21 transformer
replaces only the relevant FILE_NAME and PRODUCT string tokens. It validates
the exchange envelope, section structure, record arity, one-product
assumption, exact EOF, metadata, entity count, scan work, and resulting byte
size. It does not use a regular expression or reinterpret geometry.
Default metadata uses the document name for FILE_NAME, the fixed
1970-01-01T00:00:00 timestamp, and the output alias for an ordinary solid’s
product ID and name. Parts use the part number or part-node ID for product ID,
the part-node ID for product name, and the authored part description. A caller
timestamp is accepted only as a valid YYYY-MM-DDTHH:MM:SS calendar value and
is deterministic because it is explicit input. Protocol v1 accepts Unicode
scalar text in the four identity/description fields: apostrophes are doubled
for STEP, while literal backslashes and non-ASCII scalars use ISO-10303-21
\X2\...\X0\ or \X4\...\X0\ directives. Control characters and unpaired
UTF-16 surrogates are rejected.
Material identity, configuration selection, arbitrary document metadata, and
arbitrary part metadata are not representable through this current mapping.
Aggregate assembly and body-set exact STEP export remains unsupported.
The 64 KiB metadata budget measures the five resolved strings as UTF-8.
Part 21 escaping can expand Unicode or backslash text, and that expanded form
counts toward the 64 MiB returned-output ceiling.
The byte guarantee is deliberately narrow: identical bytes require the same
backend shape representation, options, metadata, implementation, and exact
runtime artifact. It is not geometric canonicalization, cross-runtime cache
identity, or a canonicalizer for imported or third-party STEP files.
These methods return bytes or text synchronously from a live evaluated output.
Generic BREP exchange does not preserve InvariantCAD wrapper lineage, topology
annotations, cached evaluator state, or durable artifact identity.
Licensing boundary
occt-wasm is MIT-licensed glue around OpenCascade Technology, which is LGPL
2.1 with the Open CASCADE exception. Distributors must preserve the applicable
notices, source/relinking path, and replacement rights. Read
THIRD_PARTY_NOTICES.md
before redistributing a runtime bundle.