Script-Driven Parametric Wood Planner & Renderer
TimberCAD uses a chainable JavaScript DSL for parametric construction.
// Standard size
const p1 = Timber.spawn("2x4", { length: 2400 });
// Custom size
const p2 = Timber.spawnCustom({
width: 45, depth: 195, length: 3000
});
p1.setPosition(x, y, z)
.rotateX(45)
.move(100, 0, 0)
.setPivot("START_CENTER")
.alignTo(p2.getAnchor("END_CENTER"));
p1.cutStart(200, 0, 45); // distance, angleX, angleY
p1.cutEnd(800, 0, -45);
p1.cutBox({ position: [0,0,0], size: [50,50,50] });
const wall = Timber.group();
p1.setGroup(wall);
Timber.array(p1, { count: 10, step: [600, 0, 0] });