meshBuilder
Merged, vertex-coloured runtime mesh builder used by the Endless Stairs kit. Add bevelled boxes, frustums/cylinders/cones, ellipsoids, tori, prisms (gear and star outlines) and flat polygons in a local frame (`setFrame(MB.frame(x,y,z,yaw,scale))`); palette colours are sRGB and co…
meshBuilder
Merged, vertex-coloured runtime mesh builder used by the Endless Stairs kit. Add bevelled boxes, frustums/cylinders/cones, ellipsoids, tori, prisms (gear and star outlines) and flat polygons in a local frame (setFrame(MB.frame(x,y,z,yaw,scale))); palette colours are sRGB and converted to linear vertex colours as they are written. build() uploads one renderer.mesh.create GPU mesh, so a whole chunk of stairs or props is a single draw call. Reusable for any procedural low-poly 'toy diorama' modelling.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
v(x: number, y: number, z: number) → Vec
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number |
frame(px: number, py: number, pz: number, yaw: number?, sx: number?, sy: number?, sz: number?, pitch: number?, roll: number?) → Frame
A frame at (px,py,pz), turned `yaw` radians about +Y (yaw 0 keeps -Z forward), then tilted `pitch` about its own X and `roll` about its own Z, scaled by sx, sy, sz.
| arg | type | description |
|---|---|---|
| px | number | |
| py | number | |
| pz | number | |
| yaw | number? | |
| sx | number? | |
| sy | number? | |
| sz | number? | |
| pitch | number? | |
| roll | number? |
basis(o: Vec, x: Vec, y: Vec, z: Vec) → Frame
A frame from an origin and three axis vectors (already scaled).
| arg | type | description |
|---|---|---|
| o | Vec | |
| x | Vec | |
| y | Vec | |
| z | Vec |
wrapOrigin(o: { number }) → void
| arg | type | description |
|---|---|---|
| o | { number } |
new(origin: { number }?) → Builder
| arg | type | description |
|---|---|---|
| origin | { number }? |
setUVOrigin(self: Builder, x: number, y: number, z: number) → void
Path-space position of the mesh's origin, added to every vertex for its UV.
| arg | type | description |
|---|---|---|
| self | Builder | |
| x | number | |
| y | number | |
| z | number |
setFrame(self: Builder, f: Frame?) → void
| arg | type | description |
|---|---|---|
| self | Builder | |
| f | Frame? |
vertexCount(self: Builder) → number
| arg | type | description |
|---|---|---|
| self | Builder |
tp(f: Frame, x: number, y: number, z: number) → void
Local point -> mesh space through the current frame.
| arg | type | description |
|---|---|---|
| f | Frame | |
| x | number | |
| y | number | |
| z | number |
tn(f: Frame, x: number, y: number, z: number) → void
| arg | type | description |
|---|---|---|
| f | Frame | |
| x | number | |
| y | number | |
| z | number |
lin(v: number) → number
| arg | type | description |
|---|---|---|
| v | number |
push(self: Builder, x: number, y: number, z: number, nx: number, ny: number, nz: number, c: Color) → number
Raw vertex in mesh space. Every vertex also gets a box-projected UV in metres of path space (mesh position + the builder's wrapped `uvOrigin`), which the stairSurface shader reads its detail from: stable across origin rebases, since path space never shifts.
| arg | type | description |
|---|---|---|
| self | Builder | |
| x | number | |
| y | number | |
| z | number | |
| nx | number | |
| ny | number | |
| nz | number | |
| c | Color |
idx(self: Builder, a: number, b: number, c: number) → void
| arg | type | description |
|---|---|---|
| self | Builder | |
| a | number | |
| b | number | |
| c | number |
polyW(self: Builder, pts: { { number } }, c: Color, out: { number }?) → void
A flat polygon (convex, points in mesh space as {x,y,z} arrays), wound so it faces away from `out` when given, else as listed (counter-clockwise).
| arg | type | description |
|---|---|---|
| self | Builder | |
| pts | { { number } } | |
| c | Color | |
| out | { number }? |
poly(self: Builder, pts: { { number } }, c: Color, outLocal: { number }?) → void
Flat polygon from LOCAL points (through the frame).
| arg | type | description |
|---|---|---|
| self | Builder | |
| pts | { { number } } | |
| c | Color | |
| outLocal | { number }? |
quadW(self: Builder, a: { number }, b: { number }, c: { number }, d: { number }, col: Color) → void
Quad in mesh space, counter-clockwise as seen from its front.
| arg | type | description |
|---|---|---|
| self | Builder | |
| a | { number } | |
| b | { number } | |
| c | { number } | |
| d | { number } | |
| col | Color |
shade(c: Color, k: number) → Color
| arg | type | description |
|---|---|---|
| c | Color | |
| k | number |
mix(a: Color, b: Color, t: number) → Color
| arg | type | description |
|---|---|---|
| a | Color | |
| b | Color | |
| t | number |
box(self: Builder, cx: number, cy: number, cz: number, hx: number, hy: number, hz: number, c: Color, bevel: number?, top: Color?) → void
A softly bevelled box centred at local (cx,cy,cz), half extents hx,hy,hz. `bevel` is the chamfer size; `top` optionally colours the +Y face.
| arg | type | description |
|---|---|---|
| self | Builder | |
| cx | number | |
| cy | number | |
| cz | number | |
| hx | number | |
| hy | number | |
| hz | number | |
| c | Color | |
| bevel | number? | |
| top | Color? |
P(x: number, y: number, z: number) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number |
cyl(self: Builder, cx: number, y0: number, cz: number, r0: number, r1: number, h: number, seg: number, c: Color, caps: boolean?, capColor: Color?) → void
A frustum along local +Y from y0 to y1 with radii r0 (bottom) and r1 (top), smooth sides, flat caps.
| arg | type | description |
|---|---|---|
| self | Builder | |
| cx | number | |
| y0 | number | |
| cz | number | |
| r0 | number | |
| r1 | number | |
| h | number | |
| seg | number | |
| c | Color | |
| caps | boolean? | |
| capColor | Color? |
sphere(self: Builder, cx: number, cy: number, cz: number, rx: number, ry: number, rz: number, seg: number, c: Color, c2: Color?) → void
An ellipsoid centred at local (cx,cy,cz), smooth normals.
| arg | type | description |
|---|---|---|
| self | Builder | |
| cx | number | |
| cy | number | |
| cz | number | |
| rx | number | |
| ry | number | |
| rz | number | |
| seg | number | |
| c | Color | |
| c2 | Color? |
torus(self: Builder, cx: number, cy: number, cz: number, R: number, r: number, seg: number, side: number, c: Color, stripe: Color?) → void
A torus in the local XZ plane around (cx,cy,cz).
| arg | type | description |
|---|---|---|
| self | Builder | |
| cx | number | |
| cy | number | |
| cz | number | |
| R | number | |
| r | number | |
| seg | number | |
| side | number | |
| c | Color | |
| stripe | Color? |
prism(self: Builder, outline: { { number } }, y0: number, y1: number, c: Color, capColor: Color?) → void
A prism: a star-shaped outline in local XZ (list of {x,z}), extruded along +Y from y0 to y1. Flat caps, flat sides.
| arg | type | description |
|---|---|---|
| self | Builder | |
| outline | { { number } } | |
| y0 | number | |
| y1 | number | |
| c | Color | |
| capColor | Color? |
gearOutline(r: number, toothH: number, teeth: number) → void
A gear outline: `teeth` teeth between radius r (root) and r + toothH.
| arg | type | description |
|---|---|---|
| r | number | |
| toothH | number | |
| teeth | number |
at(t: number, rad: number) → void
| arg | type | description |
|---|---|---|
| t | number | |
| rad | number |
starOutline(r: number, inner: number, points: number) → void
A regular polygon / star outline.
| arg | type | description |
|---|---|---|
| r | number | |
| inner | number | |
| points | number |
circleOutline(r: number, seg: number) → void
| arg | type | description |
|---|---|---|
| r | number | |
| seg | number |
build(self: Builder) → any
Upload as a runtime GPU mesh; nil when empty.
| arg | type | description |
|---|---|---|
| self | Builder |
triangleCount(self: Builder) → number
| arg | type | description |
|---|---|---|
| self | Builder |
Vec = { x: number, y: number, z: number }Frame = { o: Vec, x: Vec, y: Vec, z: Vec }Color = { number }Builder = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.