Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • Lua is the only language that's born to be embedded — tiny, fast to start, trivial to bind.
  • The change history on this repository is fascinating
  • Isn't OpenSCAD's limited (non-Turing complete) language a feature?
  • Yes, it is.

    The most notable aspect of this (and one which I've complained in the past) is the inability to write out file, which has security implications.

  • I'm pretty sure it's Turing complete by now. If it was conceptualized as a limited language and only became a full fledged programming language over time, it would certainly explain all its weird warts. (Here is some more details: https://github.com/ad-si/LuaCAD#why-lua) I guess 3D modeling is just too complex for a simple, but limited DSL.

    Lua is easier to use, faster, and more feature-rich. It's one of those rare occasions when a new solution is actually better in every single way.

  • 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.

  • 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. ;-)

  • Honest question here -- for doing 3D parametric design, is the "programmatic" approach a good thing? If you compare doing a design in LuaCAD to something like Solidworks or ProE, can you get to the end result faster, and easier?
  • I've tried to get into Solidworks, Fusion, and FreeCAD several times, but every time I come back to programmatic CAD. It just better matches how I think about 3D design I guess. Also, I love that there can't be any hidden state or constraints -everything is fully defined by your code and fully visible.

    Just give it a try, I guess, and see if it works for your use cases!

  • 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?
  • 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!
  • Awesome! I use both OpenSCAD and BOSL2, looking forward to test it!
  • A scripting engine is a great feature in cad, you should be proud of your achievement. The reason I'm not personally interested is that i used lisp in AutoCAD in the 00s. What i like most about lua is that it's not php. It's a sane choice, but insipid.

    https://www.cadtutor.net/tutorials/autolisp/quick-start.php

    by psd1
  • 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
  • Does this have a web-based playground? I find https://www.pythonscad.org/playground/ to be nice to try out the project.
    by fhn
  • I was actually able to get a first version released just now: https://luacad.ad-si.com/playground It's still rather bare bones and won't work well for large models, but otherwise it should be fully functional!
  • Agreed! I’m already working on it, but it’s not quite ready yet. ETA is 1-2 weeks.
LuaCAD – Parametric CAD Scripted in Lua · Birbla