3 ms·
Yep. 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 librari
by 6d65 6y ago
Yep. 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.