OpenSCAD Web is a browser-based OpenSCAD editor, previewer, and customizer built around a headless WebAssembly build of OpenSCAD. The app uses Lit for the UI shell, Monaco for editing, Three.js for 3D viewing, BrowserFS for the virtual filesystem, and Vite for app and worker bundling.
Licensing and bundled third-party notices live in LICENSE.md.
- Automatic preview on edit and full render on demand
- Monaco-based SCAD editor with syntax highlighting and completions
- Three.js-based OFF viewer with persisted camera state
- Customizer and embed URL modes
- Bundled SCAD library corpus with BrowserFS-backed virtual mounts
- Installable PWA with offline support via Workbox-generated service worker
- Lit web components for the application shell
- Vite for app and worker bundling
- Vitest for unit tests
- Playwright for browser E2E
- explicit Node build scripts for WASM, font, and library packaging from
libs-config.json - Workbox
generateSWfor production service worker generation
Runtime notes:
- runtime asset URLs resolve through
import.meta.env.BASE_URL - the OpenSCAD runtime JS/WASM now flows through the Vite asset graph
- BrowserFS is bundled into the app and worker runtime instead of loaded from a standalone public script
- editor mode eagerly mounts libraries on the main thread for browsing and completions
- embed and customizer flows continue to rely on demand-loaded libraries in compile paths
- Node.js
>=24 - npm
- git
zipcurlorwget- Docker with amd64 container support only if you need to rebuild the OpenSCAD wasm from source
Install dependencies and prepare the generated assets:
npm install
npm run build:libsStart the Vite dev server:
npm run start
# http://localhost:4000/Run the broad local verification path:
npm run verifyRun the full verification path, including browser checks for both the hosted app and the publish artifact:
npx playwright install chromium
npm run verify:fullRun a local production-style build and serve it from /dist/:
npm run start:production
# http://localhost:3000/dist/Assembly and deploy-tooling tests:
npm run test:assemblyUnit tests:
npm run test:unitBrowser E2E against the canonical production-style path:
npx playwright install chromium
npm run test:e2eBrowser E2E against the Vite dev server:
npx playwright install chromium
npm run test:e2e:devBrowser E2E against the publish artifact:
npx playwright install chromium
npm run test:e2e:publishPrepare all generated assets and compile the app:
npm run build:allThe app is deployed as a static dist/ directory. The build path is controlled by PUBLIC_URL, and the checked-in default deployment root is also reflected in package.json#homepage.
For deployment details, self-hosting notes, and GitHub Pages behavior, see docs/DEPLOYMENT.md. For publishing OpenSCAD projects into GitHub Pages or another static-site tree, see docs/PUBLISHING.md.
Security assumptions, CSP guidance, and external-source loading policy are documented in docs/SECURITY.md.
The module layout, dependency boundaries, compile lifecycle, and the decision records behind the current design live in docs/architecture/.
Contributor workflow, verification expectations, and repo conventions are documented in docs/CONTRIBUTING.md.
Performance baseline usage is documented in docs/PERFORMANCE.md.
The library and runtime asset pipeline is driven by libs-config.json.
Useful commands:
npm run build:libs- build all generated assetsnpm run build:libs:clean- remove generated asset outputsnpm run build:libs:wasm- refresh only the OpenSCAD wasm/runtime artifactsnpm run build:libs:fonts- refresh only packaged font assetsnpm run build:libs:libraries- rebuild only packaged library ZIPs and generated registry metadata
Adding a new bundled library requires updating:
If you need to rebuild the OpenSCAD wasm instead of using the fetched prebuilt runtime:
npm run build:libs:wasmThen rebuild the rest of the asset pipeline and run the app normally:
npm run build:libs
npm run start