Introducing LuaSCAD: A Lua-based Alternative to OpenSCAD
— 221 Words — 2 min
Introducing LuaSCAD: A Lua-based Alternative to OpenSCAD
I'm excited to announce the release of LuaSCAD, a project I've been working on that brings together the power of Lua programming and parametric 3D modeling.
What is LuaSCAD?
LuaSCAD is a Lua-based library for creating 3D models programmatically. If you're familiar with OpenSCAD, think of LuaSCAD as its Lua cousin - maintaining the parametric and code-driven approach while leveraging Lua's clean syntax and powerful standard library.
Key Features
- Full Lua Language Support: Use all of Lua's features including tables, functions, and modules
- OpenSCAD-like API: Familiar functions like
cube()
,sphere()
, andcylinder()
- DXF Import/Export: Work with 2D designs seamlessly
- VRML Export: Export your 3D models in VRML format
- Intuitive Combining: Use the
+
operator to combine models
Getting Started
local cad = require "lib_cad"
-- Create a simple model
local base = cad.cube({size = {10, 10, 2}})
local pillar = cad.cylinder({r = 2, h = 8})
local model = base + pillar:translate({0, 0, 2})
-- Export the model
model:exportWrl("temp/simple_model.wrl")
Why LuaSCAD?
As someone who's used OpenSCAD extensively, I've often wished for a more flexible programming language underneath. Lua offers:
- A cleaner, more familiar syntax
- Better performance with LuaJIT
- Richer standard library
- Easier integration with other systems
What's Next?
This is just the beginning for LuaSCAD. I'm planning to add:
- More primitives and transformations
- Additional export formats (STL, OBJ)
- Better documentation and examples
- Performance optimizations
Try It Today
Check out the GitHub repository to get started with LuaSCAD. Contributions, feedback, and bug reports are all welcome!
Happy modeling!
If you have any comments, thoughts, or other feedback feel free to write me @AdrianSieber. Thanks for your help! 😊