Builtin Library
README.md
mesh.rounded_box
A box with rounded edges and corners centred on the origin: each face is a lattice pushed out onto the rounded outline, with smooth normals across the rounding. Use it for soft blocks, buttons and furniture.
The rounding radius is 0.15 of the shortest side. Each face is a 9 by 9 lattice, so the box has 486 points and 768 triangles.
Inputs
size(Vec3, default { x = 1, y = 1, z = 1 }). The box's width, height and depth along X, Y and Z, in metres.
Outputs
geometry(Geometry). Triangles withP,Nanduvon their points; primitives carryvstartandvcount.
local cushion = g.mesh.rounded_box({ size = vector.create(1, 0.3, 1) })