# STEP converter corresponding source and local replacement This kit accompanies occt-import-js 0.0.23 / Open CASCADE Technology 7.6.1. The upstream source archives are complete, pinned by SHA-256 in provenance.json, and retain their upstream licenses. OCCT is LGPL 2.1 with its included exception; occt-import-js retains its LGPL license. The Emscripten SDK retains its own license (see emsdk.tar.gz). Compiler binaries are obtained separately by emsdk. No private application source or user model is needed to use this kit. ## Contents - wrapper.tar.gz: upstream occt-import-js source, build scripts and sample STEP files. - occt.tar.gz: the complete source of the exact OCCT submodule (not an empty gitlink). - emsdk.tar.gz: Emscripten SDK 3.1.69 installation scripts. - provenance.json: source commits, URLs, versions and archive checksums. - module-tail.js: minimal browser ES-module export appended to the upstream JS. - build.mjs: standalone extraction, build and replacement helper. - download-runtime.mjs: standalone public runtime downloader (Node.js 22+). - OCCT_LGPL_EXCEPTION.txt: unmodified OCCT exception. The ESM adapter is offered under LGPL-2.1-or-later. Both helpers and this guide are offered under MIT (COPYING.helpers.txt); the site's proprietary license does not override these grants or any third-party rights. ## Build on macOS or Linux (Windows: use WSL) Requirements: Node.js 22+, Python 3, CMake, Ninja, tar, bash; network access for the first Emscripten toolchain installation. Allow several GB of working disk and time for the full C++ compilation. No global SDK installation is performed. 1. Download occt-source-kit.zip and its .sha256 from the site's legal page. These use immutable versioned URLs, listed in legal/occt-source-kit.json; the source archive is stored independently of ordinary app releases. 2. Verify SHA-256, unzip into a new directory, then open a terminal there. 3. Run: node build.mjs --jobs 4 This verifies the source archives, extracts the wrapper and its OCCT dependency, installs Emscripten 3.1.69 under work/emsdk, and builds into work/build. Files in an existing work/source directory are preserved so you can modify the library. The official site continues to distribute the reviewed upstream NPM WASM; this recipe builds a compatible replacement, not a promise of byte-identical output across hosts. CMake >=4 is supported using a policy compatibility argument, without modifying the upstream CMakeLists.txt. Outputs: work/replacement/module.js and work/replacement/occt-import-js.wasm. Both must be replaced together; the factory must retain ReadStepFile's API. ## Demonstrate a real modification node build.mjs --jobs 4 --marker This adds a console marker to the extracted C++ ReadStepFile entry point and rebuilds the WASM. Importing a STEP must log vexcad-lgpl-replacement-v1, including when called inside the application's conversion Worker. It is a test change, not part of the official runtime. You can instead edit work/source yourself. To return to pristine sources, unpack the kit into another new directory. ## Replace the library in a local copy of the application The legal page provides download-runtime.mjs and application-runtime.json. Download the helper (also included in this kit), then run with Node.js 22+: node download-runtime.mjs https://cad.varlet.cn/ ./local-runtime Use the exact website root URL of the release you downloaded the kit from. The helper copies the existing public browser build and static resources to a new directory, verifying every file's size and SHA-256. It needs no npm packages or private repository. Four parallel requests keep server load bounded. On a network failure, run the same command to resume verified files; if the website release changed, use a new directory. Existing modified files are never overwritten. Keep this local copy before deploying a new release if you need that exact version. This advanced workflow downloads more separate files than a ZIP, but eliminates a redundant whole-site archive on the server. Ordinary visitors do not run it. In local-runtime, copy the two replacement outputs over: assets/occt/0.0.23/module.js assets/occt/0.0.23/occt-import-js.wasm Serve that directory locally, for example (run from local-runtime): python3 -m http.server 8080 --bind 127.0.0.1 Open http://127.0.0.1:8080/ in a fresh browser profile, use the normal STEP import dialog, and choose a STEP (the wrapper source includes test/testfiles examples). The import must complete and the modified C++ marker must appear in the console. There is no runtime byte/signature check preventing compatible replacements. Official production-build checks only guard what the maintainer publishes. Your local origin uses separate browser storage: export a model first if needed. You may modify the local work for your own use and reverse engineer to debug those modifications as required by LGPL 2.1 section 6. This does not grant a general right to republish the proprietary application as a public service. Third-party materials in the application retain their own permissions/limits. The local copy includes LICENSE.txt/terms/notices under legal/. It excludes the large source kit and the manifest itself; download the source kit separately. Normal website startup requests neither the source kit nor the manifest. Do not use file:// because browser module and Worker loading require HTTP. ## 中文说明 本包提供实际发布转换器所对应的上游源码、完整 OCCT 子模块及构建材料。解压后 运行 node build.mjs;再加 --marker 可验证真实 C++ 修改后的 WASM。构建工具首次 联网下载,安装在本目录内,不修改系统配置。网站本身不在首屏下载这个源码包。 “版权与许可”页面的 download-runtime.mjs 按发布清单下载并校验已有静态文件, 不需要私有源码或另存一份整站 ZIP。使用 Node.js 22+ 运行上面的命令,输出目录 必须新建(同版本未完成下载可续传,修改过的文件不会覆盖)。随后在本机副本中 替换 assets/occt/0.0.23/ 下的 module.js 和 occt-import-js.wasm,再以本机 HTTP 服务打开,即可通过正常 STEP 导入流程验证。此本机修改/调试权利不等于 获得把原创网站另行公开部署的通用许可。涉及第三方资料仍遵守其自身许可。