Builtin Library
README.md
mesh.cube_faces
For a column of face numbers 0 to 5 (+X, -X, +Y, -Y, +Z, -Z), the outward unit normal of the face and the two unit axes it spreads along. The cross product of the first axis and the second is the normal, so a lattice laid along them winds outward.
Inputs
face(Column<Int>). The face each element belongs to, from 0 to 5.
Outputs
normal(Column<Vec3>). The outward unit normal of each element's face.along(Column<Vec3>). The first axis of the face.across(Column<Vec3>). The second axis of the face.
local lattice = g.mesh.lattice({ shape = "grid", count = 2, across = 2, owners = 6 })
local faces = g.mesh.cube_faces({ face = lattice.owner })
local made = lattice.geometry
made.point.P = faces.normal * 0.5 + faces.along * (lattice.x - 0.5) + faces.across * (lattice.y - 0.5)