addV(g: ?, x: ?, y: ?, z: ?, nx: ?, ny: ?, nz: ?, u: ?, v: ?, cr: ?, cg: ?, cb: ?) → void
| arg | type | description |
|---|
| g | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| nx | ? | |
| ny | ? | |
| nz | ? | |
| u | ? | |
| v | ? | |
| cr | ? | |
| cg | ? | |
| cb | ? | |
lin(c: ?) → void
Colours handed to the builders are sRGB; vertex colours are linear.
norm3(x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|
| x | ? | |
| y | ? | |
| z | ? | |
tri(g: ?, a: ?, b: ?, c: ?) → void
Add a triangle, winding it so its face agrees with the vertex normals
(counter-clockwise seen from outside).
| arg | type | description |
|---|
| g | ? | |
| a | ? | |
| b | ? | |
| c | ? | |
loft(g: ?, rings: ?, opts: ?) → void
rings: list of { y, rx, rz?, cx?, cz? } in order along the shape. A ring with
rx = 0 closes the end at a point. opts:
segs ring resolution (default 16)
mod(t, a) radial multiplier at ring parameter t (0..1) and angle a
off(t, a) extra { dx, dy, dz } at a vertex (for asymmetric bumps)
ao(t, a, ny) -> shade 0..1 (default: a soft occlusion toward ends/underside)
a0, a1 angle range for an open loft (a cape's arc); default full circle
color { r, g, b } multiplied into the vertex colour
xform function(x, y, z) -> x, y, z applied to every point (normals follow)
| arg | type | description |
|---|
| g | ? | |
| rings | ? | |
| opts | ? | |
ellipsoid(g: ?, c: ?, r: ?, opts: ?) → void
Ellipsoid centred at c with radii r = {rx, ry, rz}.
| arg | type | description |
|---|
| g | ? | |
| c | ? | |
| r | ? | |
| opts | ? | |
limb(g: ?, len: ?, r0: ?, r1: ?, opts: ?) → void
Capsule-like limb segment along -Y from the origin: length len, radius at the
top r0 and bottom r1 (depth scale dz), rounded ends.
| arg | type | description |
|---|
| g | ? | |
| len | ? | |
| r0 | ? | |
| r1 | ? | |
| opts | ? | |
tube(g: ?, pts: ?, radius: ?, opts: ?) → void
Tube swept through points (each {x,y,z}) with radius list or number.
| arg | type | description |
|---|
| g | ? | |
| pts | ? | |
| radius | ? | |
| opts | ? | |
torus(g: ?, y: ?, R: ?, r: ?, opts: ?) → void
Torus around +Y at height y: major radius R (rx, rz), minor radius r.
| arg | type | description |
|---|
| g | ? | |
| y | ? | |
| R | ? | |
| r | ? | |
| opts | ? | |
sheet(g: ?, nu: ?, nv: ?, pos: ?, opts: ?) → void
Double-sided sheet: pos(u, v) -> x, y, z over a (nu x nv) grid, front facing
`outward(u,v)` -> nx,ny,nz hint (default from cross product), thickness th.
| arg | type | description |
|---|
| g | ? | |
| nu | ? | |
| nv | ? | |
| pos | ? | |
| opts | ? | |
box(g: ?, c: ?, h: ?, opts: ?) → void
Rounded box centred at c with half-size h (a superellipsoid loft).
| arg | type | description |
|---|
| g | ? | |
| c | ? | |
| h | ? | |
| opts | ? | |
mat(yaw: ?, pitch: ?, roll: ?) → void
Rotation matrix from yaw (Y), pitch (X), roll (Z): R = Ry * Rx * Rz.
| arg | type | description |
|---|
| yaw | ? | |
| pitch | ? | |
| roll | ? | |
xform(g: ?, from: ?, m: ?, s: ?, t: ?) → void
Transform the vertices [from, g.nv) by rotation m (3x3, may be nil), scale s
({sx,sy,sz} or number, applied first) and translation t.
| arg | type | description |
|---|
| g | ? | |
| from | ? | |
| m | ? | |
| s | ? | |
| t | ? | |
paint(g: ?, from: ?, col: ?) → void
Multiply vertex colours of [from, g.nv) by col.
| arg | type | description |
|---|
| g | ? | |
| from | ? | |
| col | ? | |
append(g: ?, src: ?, M: ?, col: ?) → void
Append geometry `src` (a finished table or builder) into builder g under a
3x4 world matrix M = { r = 3x3 rows, t = {x,y,z}, s = {sx,sy,sz}? } and colour.
| arg | type | description |
|---|
| g | ? | |
| src | ? | |
| M | ? | |
| col | ? | |
hash(x: ?) → void
Small deterministic hash noise for folds and wear.
folds(a: ?, k: ?, seed: ?) → void
Smooth periodic value noise around a circle: n(a) in -1..1 with k lobes.
| arg | type | description |
|---|
| a | ? | |
| k | ? | |
| seed | ? | |