Fork of openscad/openscad-playground with CMMS embedding hooks for the AI Assistant module (see /opt/DB CLAUDE.md).
  • CSS 70.6%
  • TypeScript 25.2%
  • JavaScript 3.2%
  • HTML 0.8%
  • OpenSCAD 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2023-03-27 19:34:52 +01:00
public Tweak position of settings button on small screens 2023-03-27 16:56:26 +01:00
src Add metadata to zipArchives (display Github links in explorer) 2023-03-27 19:34:52 +01:00
.gitignore Gooood progress 2023-03-26 07:48:04 +01:00
fonts.conf Basic React + TypeScript app skeleton + downloading of deps 2023-03-24 01:58:25 +00:00
inline-openscad-worker.ts Basic React + TypeScript app skeleton + downloading of deps 2023-03-24 01:58:25 +00:00
LICENSE.md Add primereact's license + update readme 2023-03-26 16:56:35 +01:00
LICENSE.monaco Licenses 2023-03-24 01:02:41 +00:00
LICENSE.viewstl Licenses 2023-03-24 01:02:41 +00:00
Makefile Let some projects' examples through in bundled zips 2023-03-27 00:25:39 +01:00
openscad-worker.rollup.config.js fix build 2023-03-26 16:05:01 +01:00
package.json widgets, file size and elapsed time 2023-03-25 20:41:16 +00:00
README.md Add metadata to zipArchives (display Github links in explorer) 2023-03-27 19:34:52 +01:00
tsconfig.json state/model files refactoring 2023-03-26 15:28:05 +01:00
webpack.config.js Don't inline sourcemaps for prod builds 2023-03-27 01:17:14 +01:00

OpenSCAD Playground

Open the Demo

This is wrapping the headless WASM build of OpenSCAD (done by @DSchroer) into a lots of pretty PrimeReact components, slapping in a React Monaco editor (VS Codesque power!), a React STL viewer and a few tricks (of course, it's using the experimental Manifold support we've added recently, to make it super fast).

Enjoy!

An earlier iteration of this offered more control over the features that are enabled. This will come soon too.

Licenses: see LICENSES.

Features

  • Automatic preview on edit (F5), and full rendering on Ctrl+Enter (or F6). Using a trick to force $preview=true.
  • Syntax highlighting
  • Ships with many standard SCAD libraries (can browse through them in the UI)
  • Autocomplete of imports
  • Autocomplete of symbols / function calls (pseudo-parses file and its transitive imports)
  • Responsive layout (but editing on iOS is still a pain, will address that soon). On small screens editor and viewer are stacked onto each other, while on larger screens they can be side-by-side

Roadmap

  • Add tests!
  • Better names for downloads (matching source)
  • Model /home fs in shared state. have two clear paths: /libraries for builtins, and /home for user data. State pointing to /libraries paths needs not store the data except if there's overrides (flagged as modifications in the file picker)
  • Setup OPENSCADPATH env var w/ Emscripten to ensure examples will run fine.
  • Bundle some official demos and more examples from each library!
  • Ask users to contribute recipes to include more libraries, and cool examples that work in the environment
  • Drag and drop of files (SCAD, STL, etc) and Zip archives. For assets, auto insert the corresponding import.
  • Proper PWA w/ File opening / association to *.scad files
  • Animation rendering (And other formats than STL)
  • Compress URL fragment
  • Customizer support. Probably by adding --export-json or --export-format=customizer-json to OpenSCAD. And use React Hook Forms maybe? https://react-hook-form.com/
  • Mobile (iOS) editing support: switch to https://www.npmjs.com/package/react-codemirror ?
  • Proper Preview rendering: have OpenSCAD export the preview scene to a rich format (e.g. glTF, with some parts being translucent when prefixed w/ % modifier) and display it using https://modelviewer.dev/ maybe)
  • Detect which bundled libraries are included / used in the sources and only download these rather than wait for all of the zips. Means the file explorer would need to be more lazy or have some prebuilt hierarchy.
  • Preparse builtin libraries definitions at compile time, ship the JSON.

Building

Prerequisites:

  • wget
  • GNU make
  • npm

Local dev:

make public
npm start
# http://localhost:4000/

Local prod (test both the different inlining and serving under a prefix):

make public
npm run start:prod
# http://localhost:3000/dist/

Deployment (edit "homepage" in package.json to match your deployment root!):

make public
npm run build

rm -fR ../ochafik.github.io/openscad2 && cp -R dist ../ochafik.github.io/openscad2 
# Now commit and push changes, wait for site update and enjoy!