Lua Cad

lua-users home
wiki

Lua CAD

Lua CAD is a bunch of lua scripts that allow you to use the Lua scripting language syntax to create valid OpenSCAD CAD files (http://www.openscad.org/). The OpenSCAD script is passed to the OpenSCAD executable which then compiles it into an STL File. Lua is then used to convert STL to OBJ for example.

Limitations:

- For Windows only (unless you edit a couple of settings yourself, anyways I have no Linux so I cannot test it)

You can find the code on Github, https://github.com/thechillcode/Lua_CAD

Example:


-- create a cube, pos 0,0,0,  width =10, height =20 and depth=30
local cube = cad.cube(0,0,0, 10,20,30)

-- export as stl
cube:export("D:\\cube.stl")
-- export as obj in red
cube:export("D:\\cube.obj", {255,0,0})

-- subtract another cube form this one

local cube_sub = cube - cad.cube(5,5,0, 10,10,10)
cube_sub:export("D:\\cube_sub.stl")

RecentChanges · preferences
edit · history
Last edited July 30, 2015 8:08 pm GMT (diff)