This is a limited port of OpenSCAD to WebAssembly, using at its core a headless WASM build of OpenSCAD (done by @DSchroer), wrapped in a UI made of pretty PrimeReact components, a React Monaco editor (VS Codesque power!), and an interactive model-viewer renderer.
It defaults to the Manifold backend so it’s super fast.
Enjoy!
Licenses: see LICENSES.
Prerequisites:
docker run --privileged --rm tonistiigi/binfmt --install all
Local dev:
make public
npm install
npm start
# http://localhost:4000/
Local prod (test both the different inlining and serving under a prefix):
make public
npm install
npm run start:prod
# http://localhost:3000/dist/
Deployment (edit homepage
in package.json
to match your deployment root!) is
handled automatically via GitHub Actions. Pushing to the main
branch triggers
the deploy.yml
workflow that builds the project
and publishes the contents of the dist
directory to GitHub Pages.
If you prefer deploying manually you can still run:
make public
npm install
NODE_ENV=production npm run build
cp -R dist /path/to/your/pages/repo
Makefile fetches a prebuilt OpenSCAD web WASM binary, but you can build your own in a couple of minutes:
Optional: use your own openscad fork / branch:
rm -fR libs/openscad
ln -s $PWD/../absolute/path/to/your/openscad libs/openscad
# If you had a native build directory, delete it.
rm -fR libs/openscad/build
Build WASM binary (add WASM_BUILD=Debug
argument if you’d like to debug any cryptic crashes):
make wasm
Then continue the build:
make public
npm start
You’ll need to update 3 files (search for BOSL2 for an example):
Makefile: to pull the library’s code (optionally alias some files for easier imports) and package it as a .zip
archive
src/fs/zip-archives.ts: to use the .zip
archive in the UI (both for file explorer and automatic imports mounting)
LICENSE.md: most libraries require proper disclosure of their usage and of their license. If a license is unique, paste it in full, otherwise, link to one of the standard ones already there.
Send us a PR, then once it’s merged request an update to the hosted https://ochafik.com/openscad2 demo.