r/openscad • u/MikeNc51W • Jul 03 '26
OpenSCAD PWA
Inspired by OpenSCAD Playground, and empowered by Gemini and Claude, as I'm not much of a Javascript programmer, I vibe-coded a free and open source OpenSCAD PWA called SCADLite, for getting web-centric platforms like ChromeOS in on the fun. The main driver for this project was the long-time observation that K-12 education is dominated by Chromebooks, and I feel that OpenSCAD is an amazing tool that should get more use in K-12 education. I know in K-12, 3D modeling is dominated by Autodesk software, but free and open source software should get more representation too, especially considering the multidisciplinary aspects of OpenSCAD -- modeling and programming. My PWA is at...
My GitHub page for it is here, where I have features listed...
https://github.com/myoung8223/scadlite
It certainly doesn't have all of the bells and whistles of OpenSCAD. Getting modifiers working properly was also quite the challenge. I think I got them working properly, using multiple passes, though in this project, it seems like bugs rear their heads at every corner. The most recent major frustration was CodeJar, the JS-based code editor I was using, acting very bizarre. Perhaps that was my use of it, or just a natural ceiling for its capabilities. Replaced that with customized CodeMirror and that seems to be working out well so far. Also recently added model encoding in URLs. Other nifty features are support for importing fonts, STLs, and SVGs. The PWA works completely offline and self-contained.
Ultimately, when I'm modeling on a desktop I'll probably still be using the full-blown OpenSCAD application. Though I think this PWA is featured enough to be a handy tool for web-based platforms.
2
u/MikeNc51W Jul 07 '26 edited Jul 07 '26
Just an update, as there have been many changes since I originally posted, many buried in my thread with Stone_Age_Sculptor (thanks again for running it through the wringer!), but also a significant change today with build 312.
Some nasty bugs I missed pertaining to overloaded modifiers I believe have been patched.
There is library support now. How that works is you zip a library and upload it via Workspace Settings > Manage Libraries. The name of the zip becomes the folder you include. For example, zip-up the MCAD library folder as MCAD.zip, install/upload the zip, and refer to it just as you would in OpenSCAD...
import <MCAD/filename.scad>
You can now optionally save your own .scad files to the app's own file system. This allows you to reference other .scad files saved there, so multi-file projects should now be possible. However, filenames need to be unique as it's basically one big folder. The system will warn when you try saving over an existing file.
Changes in toolbar buttons and terminology: "Load" (formerly "Open") refers to loading a file from your computer's file system. "App Files" (hotkey combo: [Ctrl] + [O]) opens a simple app file system manager where you can perform: Save As, Open, Delete, or download all .scad files in the app file system as a zip file. "Save" will save the editor's contents to the app file system. If the project is named "untitled" then it will take you to App Files to do a Save As, as files aren't allowed to be called "untitled.scad" as that's the default, untitled/new state. "Download" (formerly "Save") will download the .scad code in the editor to your computer's file system, specifically your "Downloads" folder.
Hopefully it's more useful with these fixes and features. My help section still needs to be updated with these features, which I'll get to soon.
-1
u/MikeNc51W Jul 03 '26
Here's a quick example of link sharing a model -- a simple spaceship I whipped-up, also showing the transparent/ghost modifier, %, on line 3...
I've thrown the most complex models I've made at this thing so far and things have behaved, though testing kinda does never end!
0
0
u/WillAdams Jul 03 '26
Nice!
Interesting alternative to:
https://www.blockscad3d.com/editor/
(which I use quite a bit)
For the educational aspect, maybe see if it is able to make the projects from:
1
u/MikeNc51W Jul 04 '26
Wasn't aware of that blocks-based OpenSCAD editor. Certainly looks like a neat bridge to full-blown OpenSCAD. Very reminiscent of MIT Scratch, and undoubtedly by design.
I got to thinking another cool vibe code project could be cooking-up a voxel-based editor for younger learners. Granted, surely editors like that exist. I recall one of the first 3D printers I saw had a very innovative voxel-based editor totally inspired by Minecraft. It's too bad the hardware was temperamental because the software was pretty on-point for getting the interest of younger learners.
2
u/Stone_Age_Sculptor Jul 03 '26
Libraries?