# CAD reader for johnmcm.com The engine behind johnmcm.com's STEP & IGES Viewer (/step-viewer). It is [occt-import-js](https://github.com/kovacsv/occt-import-js) 0.0.23 by Viktor Kovacs: [Open CASCADE Technology](https://dev.opencascade.org) compiled to WebAssembly with Emscripten. Both are LGPL-2.1 (OCCT with the Open CASCADE exception); the licence texts are `LICENSE` (occt-import-js) and `LICENSE.occt`. - The WebAssembly module, `occt-import-js.wasm`, is used exactly as published on npm. - The JavaScript loader, `occt-import-js.js`, is patched by `patch.mjs`. Its embind layer builds the wrappers between JavaScript and C++ by generating source text and compiling it with `new Function`, which this site's Content Security Policy does not allow. `patch.mjs` rewrites the two functions that do that (`craftInvokerFunction` and `__emval_get_method_caller`) as plain closures doing the same steps, as Emscripten does when built with `-sDYNAMIC_EXECUTION=0`. Nothing else is changed. To rebuild, run `node wasm-src/occt/patch.mjs` from `frontend/`. It downloads the npm file, checks its hash, patches it and writes `frontend/vendor/local/occt@1/`. The page loads the loader and the module as separate files, so either can be replaced with one built from modified source.