Builtin Library
README.md
mesh.box
A box centred on the origin: six faces of two triangles each, with flat normals and the unit square as texture coordinates on every face. Use it for crates, walls and any block a graph cuts, stacks or displaces.
Each face holds its own four points, so the box has 24 points and 12 triangles, and every point carries its face's normal. The faces are laid out +X, -X, +Y, -Y, +Z, -Z.
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 crate = g.mesh.box({ size = vector.create(2, 1, 1) })