jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.66k stars 515 forks source link

Make it output Tinkercad Shape Generator code #379

Open probonopd opened 6 years ago

probonopd commented 6 years ago

SCAD (and OpenJSCAD) are great for coding parametrized models, and Tinkercad is great for making one-off changes quickly and interactively. Right now it is possible to import STL models into Tinkercad, e.g., those generated by OpenSCAD.

However, Tinkercad also offers users to script their own Shape Generators in JavaScript. Compared to the relatively simple SCAD language, I find the Tinkercad Shape Generators rather convoluted and cumbersome though (you have to calculate the position of individual points in 3D space rather than to deal with simple geometric objects).

Hence, I wonder whether it would be possible for OpenJSCAD to produce output code that could be used as Tinkercad Shape Generators. After all, both use JavaScript. I am sure this would be an instantly popular "killer feature".

Example use case: I want to add some cutouts and do some other customizations to a parametrized SCAD electronics enclosure like https://www.thingiverse.com/thing:2866563 in Tinkercad, but writing the equivalent of that model from scratch as a Tinkercad Shape Generator is way more cumbersome than doing the same in SCAD.

z3dev commented 6 years ago

Cool idea. I was actually looking at that a long time ago. If only Tinkercad was open source then we could peek in to see the hierarchy... but we all know that’s impossible now that Autocad owns it.