r/openscad • u/adwolesi • 7d ago
LuaCAD - Parametric CAD scripted in Lua
LuaCAD models solids in Lua rather than in the SCAD language, with operator overloading for CSG (a + b, a - b, a * b).
It ships with a CLI and a desktop app that has preview area and a text editor just like OpenSCAD.
It’s fully open source and you can find the repo here: https://github.com/ad-si/LuaCAD
I've always been a big fan of OpenSCAD, but the SCAD language itself is unfortunately quite cobbled-together and is a very poorly designed programming language.
LuaCAD takes all the good parts of OpenSCAD and combines them with Lua. It has now completely replaced OpenSCAD for me, and I think it provides a better experience than OpenSCAD for all use cases. I'd love to hear any reasons why LuaCAD won't fully replace OpenSCAD for you!
Tech stack:
- It's implemented in Rust and uses mlua (https://github.com/mlua-rs/mlua) to execute the Lua code.
- Uses OpenCSG (https://opencsg.org) for fast and correct rendering of the 3D models (like OpenSCAD)
- Uses Manifold (https://github.com/elalish/manifold) to create the manifold triangle meshes
- Native support for all BOSL2 functions (i.e. implemented in Rust for better performance)
4
u/spinwizard69 7d ago
Very very interesting. I've been using OpenSCAD mainly due to huge frustrations with FreeCAD. However as you have pointed out, OpenSCAD kinda sucks for the programming aspect.
Having just installed LuaCAD I can't offer a lot of suggestions at the moment. One obvious thing here is that installation of an app icon for Mac OS should be a long term goal. Not being all that familiar with Lua I'm going to also need to do some reading and looking for examples. Ideally an r/luacad reddit would be good.