new(uvScale: number?) → Builder
| arg | type | description |
|---|
| uvScale | number? | |
sub(a: V3, b: V3) → V3 return
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
cross(a: V3, b: V3) → V3
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
dot(a: V3, b: V3) → number return a
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
vert(b: Builder, p: V3, n: V3, u: number, v: number) → number
| arg | type | description |
|---|
| b | Builder | |
| p | V3 | |
| n | V3 | |
| u | number | |
| v | number | |
poly(b: Builder, pts: { V3 }, uvs: { { number } }, hint: V3?) → void
Add a flat polygon (convex or star-shaped from its first vertex fan) facing `hint`.
| arg | type | description |
|---|
| b | Builder | |
| pts | { V3 } | |
| uvs | { { number } } | |
| hint | V3? | |
place(axis: string, c: V3, s: number, t: number, w: number) → V3
Place a 2D outline point (s, t) into 3D for an extrusion along `axis` at `w`.
| arg | type | description |
|---|
| axis | string | |
| c | V3 | |
| s | number | |
| t | number | |
| w | number | |
axisVec(axis: string) → V3
| arg | type | description |
|---|
| axis | string | |
extrude(b: Builder, outline: { { number } }, axis: string, c: V3, w0: number, w1: number) → void
Extrude a closed 2D outline along an axis between w0 and w1 (both caps + sides). The outline is star-shaped about its centroid.
| arg | type | description |
|---|
| b | Builder | |
| outline | { { number } } | |
| axis | string | |
| c | V3 | |
| w0 | number | |
| w1 | number | |
prism(b: Builder, profile: { { number } }, x0: number, x1: number) → void
Side profile {z, y} extruded along X from x0 to x1.
| arg | type | description |
|---|
| b | Builder | |
| profile | { { number } } | |
| x0 | number | |
| x1 | number | |
box(b: Builder, mn: V3, mx: V3) → void
Box from min to max corner.
| arg | type | description |
|---|
| b | Builder | |
| mn | V3 | |
| mx | V3 | |
circle(r: number, seg: number) → void
Circle outline with `seg` segments; `bumps` = { {angle, width, extra} } adds teeth.
| arg | type | description |
|---|
| r | number | |
| seg | number | |
ring(b: Builder, axis: string, c: V3, r: number, h: number, seg: number) → void
Cylinder about an axis through centre c, radius r, half length h.
| arg | type | description |
|---|
| b | Builder | |
| axis | string | |
| c | V3 | |
| r | number | |
| h | number | |
| seg | number | |
plate(b: Builder, a: V3, bb: V3, c: V3, d: V3, t: number) → void
A plate: quad a,b,c,d (counter-clockwise seen from its top side) thickened by t along its normal. The top face maps the texture whole: a=(0,0) top-left, b=(1,0), c=(1,1), d=(0,1).
| arg | type | description |
|---|
| b | Builder | |
| a | V3 | |
| bb | V3 | |
| c | V3 | |
| d | V3 | |
| t | number | |
bolt(b: Builder, p: V3, n: V3, r: number?, h: number?) → void
A bolt head (short cylinder) at p standing along the unit normal n.
| arg | type | description |
|---|
| b | Builder | |
| p | V3 | |
| n | V3 | |
| r | number? | |
| h | number? | |
lerp(p: V3, q: V3, f: number) → V3
Point on the segment p→q at fraction f.
| arg | type | description |
|---|
| p | V3 | |
| q | V3 | |
| f | number | |
finish(b: Builder) → any
The builder's geometry as mesh creation parameters.
| arg | type | description |
|---|
| b | Builder | |