▶ Open TrueScad in your browser
TrueScad is a Lua-scripted CAD tool similar to OpenSCAD, running entirely in the browser as a WebAssembly app. Like ImplicitCAD, it uses implicit functions to represent geometry, offering precise surfaces and smooth rounded CSG.
Write a Lua script in the left panel using the primitives below, then:
- Run — evaluates the script and shows a ray-marched preview
- Mesh — tessellates the geometry and shows a 3D mesh (drag to rotate)
- Export STL — downloads the tessellated mesh as an STL file
Drag on the preview canvas to rotate (left button) or pan (right button).
Sphere(radius)
Box(x, y, z, smooth?) -- smooth rounds the edges
Cylinder({l=length, r=radius, s=smooth?})
Cylinder({l=length, r1=r1, r2=r2, s=smooth?}) -- tapered
iCylinder(radius) -- infinite cylinder
iCone(slope) -- infinite cone
PlaneX(d) PlaneNegX(d) -- half-spaces
PlaneY(d) PlaneNegY(d)
PlaneZ(d) PlaneNegZ(d)
PlaneHessian({nx,ny,nz}, p)
Plane3Points({x,y,z}, {x,y,z}, {x,y,z})Union({obj, ...}, smooth?)
Intersection({obj, ...}, smooth?)
Difference({obj, ...}, smooth?) -- first minus the restobj:translate(x, y, z)
obj:rotate(x, y, z) -- Euler angles in radians
obj:scale(x, y, z)
obj:clone()Bend(obj, width)
Twist(obj, height)build(obj) -- sets the object to render/export
print(...) -- output appears in the log panelcube = Box(1, 1, 1, 0.3)
sphere = Sphere(0.5)
result = Difference({cube, sphere}, 0.3)
result = result:scale(15, 15, 15)
build(result)# Install JS dependencies (once)
npm install
# Build the Rust WASM module
wasm-pack build --target web
# Bundle the frontend and start the dev server
npm run serve
# → http://localhost:8080After changing Rust code, re-run wasm-pack build --target web and refresh the browser.
After changing JS/CSS in web/, the dev server rebuilds automatically.
cargo testwasm-pack build --target web --release
npm run build:release
# Output in dist/src/luascad.rs— Lua scripting engine (piccolo), exposes all geometry primitivessrc/render.rs— ray-marching renderer, writes to a pixel buffersrc/lib.rs—wasm-bindgenAPI surface (eval,render,rotate,pan,tessellate)web/— vanilla JS frontend: CodeMirror 6 editor, Three.js mesh viewbuild.mjs/serve.mjs— esbuild-based build and dev server

