openscad-playground

OpenSCAD Playground

Open the Demo

image

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.

Features

Roadmap

Building

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

Build your own WASM binary

Makefile fetches a prebuilt OpenSCAD web WASM binary, but you can build your own in a couple of minutes:

Adding OpenSCAD libraries

You’ll need to update 3 files (search for BOSL2 for an example):

Send us a PR, then once it’s merged request an update to the hosted https://ochafik.com/openscad2 demo.