Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

mesh.octahedron

An octahedron centred on the origin: six corners, one on each side of each axis, joined by eight flat triangles. Use it for gems, crystals and markers.

Each triangle holds its own three points, so the octahedron has 24 points and 8 triangles and every normal is its face's. size is the distance between the two corners on each axis.

Inputs

  • size (Vec3, default { x = 1, y = 1, z = 1 }). The extent of its points along X, Y and Z, in metres.

Outputs

  • geometry (Geometry). Triangles with P, N and uv on their points; primitives carry vstart and vcount.
local gem = g.mesh.octahedron({ size = vector.create(0.5, 1, 0.5) })