Giter Club home page Giter Club logo

tuneprint's Introduction

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
  • Installable as a PWA (then persists edits in localStorage instead of the hash fragment). On iOS just open the sharing panel and tap "Add to Home Screen".

Roadmap

  • Add tests!
  • Persist camera state
  • Support 2D somehow? (e.g. add option in OpenSCAD to output 2D geometry as non-closed polysets, or to auto-extrude by some height)
  • 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/
  • Rebuild w/ (and sync) ochafik@'s filtered kernel (openscad/openscad#4160) to fix(ish) 2D operations
  • Replace Makefile w/ something that reads the libs metadata
  • 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)
  • 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)
  • Drag and drop of files (SCAD, STL, etc) and Zip archives. For assets, auto insert the corresponding import.
  • Fuller PWA support w/ link Sharing, File opening / association to *.scad files...
  • Look into accessibility
  • Setup OPENSCADPATH env var w/ Emscripten to ensure examples that include assets / import local files will run fine.
  • Bundle more examples (ask users to contribute)
  • Animation rendering (And other formats than STL)
  • Compress URL fragment
  • Mobile (iOS) editing support: switch to https://www.npmjs.com/package/react-codemirror ?
  • 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!

tuneprint's People

Contributors

ochafik avatar t-paul avatar stockholmux avatar kintel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.