Back to News
Advertisement
aadius about 4 hours ago 10 commentsRead Article on luacad.ad-si.com

HI version is available. Content is displayed in original English for accuracy.

LuaCAD models solids in Lua rather than the OpenSCAD language, with operator overloading for CSG (`a + b`, `a - b`, `a * b`).

It ships with a CLI and a desktop app, including a preview area and a text editor.

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 one of the best scripting languages. 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 shouldn't fully replace OpenSCAD!

It’s fully open source and you can find the repo here: https://github.com/ad-si/LuaCAD

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)

Advertisement

⚡ Community Insights

Discussion Sentiment

100% Positive

Analyzed from 218 words in the discussion.

Trending Topics

#lua#https#interesting#openscad#playground#pythonscad#project#chamfers#thanks#github

Discussion (10 Comments)Read Original on HackerNews

fhn34 minutes ago
Does this have a web-based playground? I find https://www.pythonscad.org/playground/ to be nice to try out the project.
adius18 minutes ago
Agreed! I’m already working on it, but it’s not quite ready yet. ETA is 1-2 weeks.
tolugeniusabout 2 hours ago
Really interesting! I actually use freecad so I'm use to that layer of the process but I'll check this out. Also good to see the work being done in modeling software these days
manny_ratabout 2 hours ago
Love it! OpenSCAD has very painful syntax. Is it possible to easily do bevels/chamfers or does it have the same limitations as OpenSCAD there?
adiusabout 2 hours ago
Thanks! It natively supports all BOSL2 functions which include a chamfer argument (https://github.com/revarbat/BOSL/wiki#common-arguments). So that makes it quite straightforward to add chamfers to everything!
kragen10 minutes ago
Can you fillet unions? Like, if I union a cube with a smaller cube sticking out of its side, can I make a fillet so that the edge where the two cubes' faces intersect doesn't become a stress concentration point for cracks to start at? This is OpenSCAD's primary weakness from my point of view.
addaonabout 2 hours ago
Which is what separates us from the animals.
WillAdamsabout 2 hours ago
Is it able to access the file system and write/read files?

I've been doing that via PythonSCAD for my current project https://github.com/WillAdams/gcodepreview and it might be interesting to do a re-write in another language.

adiusabout 2 hours ago
Yes, it executes in a full fledged Lua environment. So you can do all the things you expect do be able to do with Lua!

I’d pick Lua over Python any day, but maybe that’s just me. ;-)

WillAdams36 minutes ago
I've had good success w/ using Lua in LuaLaTeX, so hopefully a good fit for me to exercise my programming chops. I think it will be interesting to maintain two parallel versions for comparison/contrast. Thanks!