meshkit
A small flat-shaded mesh builder - the geometry the **Helsinki Life** pieces are modelled with. Every triangle carries its own face normal, which is what gives the low-poly diorama its crisp shaded facets.
meshkit
A small flat-shaded mesh builder - the geometry the Helsinki Life pieces are modelled with. Every triangle carries its own face normal, which is what gives the low-poly diorama its crisp shaded facets.
local kit = require("game.pieces.meshkit")
local b = kit.builder()
b:extrudeX(profile, halfWidth) -- a closed { z, y } profile swept across X
b:wedge(radius, halfAngle, thickness, segments)
b:ring(inner, outer, thickness, segments)
b:tri(p0, p1, p2, facing) -- facing states which way the face points
b:quad(a, b, c, d, facing)
b:polygon(points, facing)
local mesh = renderer.mesh.create(b:build(), guid)
A face states the direction it wants to point and the builder orders the
triangle to match, so geometry is written by shape rather than by winding;
extrudeX takes its profile in either direction and orients every wall
outward from the profile's own centroid.
kit.yawQuat(deg) and kit.pitchYawQuat(pitch, yaw) build the {x, y, z, w}
rotations the pieces are posed with. builder:triangleCount() is the cheap
check that a shape actually produced geometry.
Scoped to this part · feeds back into the world's score.