5 ms·
This almost made me stop working on my own openscad inspired system in lua. It has almost everything that I think is missing from openscad: * A full programming
by 6d65 6y ago
This almost made me stop working on my own openscad inspired system in lua. It has almost everything that I think is missing from openscad:
* A full programming language
* Fillet and chamfer support
* A better viewer
The thing that I'm planning to add to my lua cad is materials and PBR in the viewer. Also, I'm still thinking if native bom support is a good idea.
But this looks slick, will definitely give it a try. Python models should be shorter than lua. But I like the lua dsl so far.
Also I'm attempting to write my own cad kernel, which is a dubious choice. But will see where that gets me.
- klysm 6y agoDamn I didn’t realize OpenSCAD didn’t have filet/chamfer! Lua certainly has its advantages over python. The dubious choices are usually the most fun even if you end up in the deep end though.
- 6d65 6y agoYep. Lua has a bunch of advantages even over python. * It can be embedded in the viewer, so the user doesn't have to install a separate distribution of libraries. Only the viewer. * It should be faster than python, even without luajit. Currently everything is done in lua, but I'm planning to write the main loop (converting the object graph into meshes and the rendering) into Rust. And have lua dsl fill in some arrays via C FFI. * Lua has a special syntax for function calls that pass an object. Ex: do_something(obj) can be written as do_something { field = value }. This and some partial application can be used to make some very nice DSLs. Ex: difference ( sphere { r = 3 }, cube { w = 2, h = 2, d = 2 } ) * Lua is a very simple language, which can be easily picked up. That being said, Python as used in CadQuery is also simple. And yes, fillet and chamfer seem to be missing openscad. There is a way to do a 2d shape then add rounded corners then extrude it. But that seems to be new, and it's a bit tricky. I'm thinking about adding a fillet modifier that finds all the sharp edges in an object and rounds them. It might be more difficult than it sounds, but, will see. Fillets and chamfers are also important for visualisations, since in nature there are no perfect sharp corners afaik.
- bayesian_horse 6y agoThe big advantage of Python over Lua is that the ecosystem is bigger and more mature. You can use SymPy for constraint modeling, for example.