ELSEIF
Your brief EB
283 stories from 101 feeds 312 clusters Refreshed 1 minute ago next pull 19:07

TECH Signal 494

LuaCAD brings Lua scripting to parametric CAD with Rust-based CSG engine

Illustration only Photo by Kimon Maritz on Unsplash

A new open-source tool lets engineers write parametric 2D and 3D models in Lua and export them to multiple mesh formats or OpenSCAD code.

WHY IT MATTERS

For engineers who script CAD models, LuaCAD offers a faster, more consistent alternative to OpenSCAD’s language while retaining compatibility. The Rust-based engine eliminates external dependencies for core operations, though OpenGL headers are still required for the GUI preview. This could streamline workflows for custom parametric design without abandoning existing OpenSCAD tooling.

Written by elseif from the cluster below · every claim links back to a source

The three things worth knowing

01

LuaCAD embeds Lua 5.4 in a Rust engine to evaluate constructive solid geometry (CSG) operations directly or via OpenSCAD.

02

The tool supports export to 3MF, STL, OBJ, PLY, OFF, AMF, and SCAD formats, with CLI and GUI options for live previews.

03

BOSL2 library support is built-in, allowing OpenSCAD-compatible scripts to render without external dependencies.

THE READ

What the cluster adds up to.

ORIGINAL ANALYSIS

LuaCAD introduces a scripting environment for parametric CAD using Lua, a language already familiar to some engineers through tools like LibreCAD and Autodesk Netfabb. The choice of Lua over OpenSCAD’s native language is framed as an improvement in power, consistency, and speed, while maintaining a similar syntax. This could lower the barrier for engineers who need to generate complex geometries programmatically but find OpenSCAD’s language limiting. The Rust-based engine ensures CSG operations are evaluated directly, reducing reliance on external tools for core functionality.

The tool’s export capabilities cover most common mesh formats used in 3D printing and manufacturing, including 3MF, STL, and OBJ. The ability to export to OpenSCAD code also means engineers can integrate LuaCAD into existing OpenSCAD workflows, using it as a preprocessor or for parts of a model that benefit from Lua’s features. However, the GUI preview tool requires OpenGL development headers, which may complicate setup on some systems. The CLI, on the other hand, is self-contained, with dependencies vendored to avoid system library conflicts.

LuaCAD’s support for the Belfry OpenSCAD Library v2 (BOSL2) is a notable inclusion, as it allows engineers to reuse existing OpenSCAD scripts without modification. The library is reimplemented in LuaCAD, so models can be previewed, rendered, or exported without needing OpenSCAD installed. This compatibility could ease adoption for teams already using BOSL2. The tool also simplifies text rendering and mesh imports, treating them as first-class geometry rather than external dependencies. However, some formats like STL and OBJ flatten multi-object models, which may limit flexibility in downstream workflows.

For engineers, LuaCAD’s operator overloading (e.g., `a + b` for union operations) could make scripts more readable and concise compared to OpenSCAD’s module-based syntax. The ability to watch files for changes and automatically rebuild models is another practical feature for iterative design. However, the tool’s reliance on a C++ compiler and CMake for building from source may introduce friction for users unfamiliar with Rust’s build system. The CLI’s `--via-openscad` flag offers a fallback for edge cases, but it reintroduces a dependency on OpenSCAD for those scenarios.

Written by elseif from the cluster below · checked for specifics the sources never contained

THE CLUSTER

Same story, 1 feed.

ORDERED BY FIRST SEEN
ad-si.com via Hacker News Show HN: LuaCAD – Parametric CAD Scripted in Lua Open ↗