new(uvScale: number?) → Geo
| arg | type | description |
|---|
| uvScale | number? | |
color(g: Geo, col: { number }) → void
| arg | type | description |
|---|
| g | Geo | |
| col | { number } | |
cross(a: V3, b: V3) → V3
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
add(a: V3, b: V3) → V3
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
sub(a: V3, b: V3) → V3
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
mul(a: V3, s: number) → V3
| arg | type | description |
|---|
| a | V3 | |
| s | number | |
projUV(g: Geo, q: V3, nrm: V3) → void
| arg | type | description |
|---|
| g | Geo | |
| q | V3 | |
| nrm | V3 | |
vert(g: Geo, q: V3, nrm: V3, u: number, v: number) → number
| arg | type | description |
|---|
| g | Geo | |
| q | V3 | |
| nrm | V3 | |
| u | number | |
| v | number | |
tri(g: Geo, a: number, b: number, c: number) → void
| arg | type | description |
|---|
| g | Geo | |
| a | number | |
| b | number | |
| c | number | |
quad(g: Geo, o: V3, eu: V3, ev: V3, rect: { number }?) → void
Quad o, o+eu, o+eu+ev, o+ev; front face = cross(eu, ev).
`rect` = {u0, v0, u1, v1} maps the quad onto an atlas cell (u along eu, v0 at o+ev side
so images read upright when ev points "up" on the picture).
| arg | type | description |
|---|
| g | Geo | |
| o | V3 | |
| eu | V3 | |
| ev | V3 | |
| rect | { number }? | |
poly(g: Geo, pts: { V3 }) → void
Arbitrary planar convex polygon (points CCW seen from the front).
| arg | type | description |
|---|
| g | Geo | |
| pts | { V3 } | |
floorRect(g: Geo, x0: number, z0: number, x1: number, z1: number, y: number, rect: { number }?) → void
Flat horizontal rectangle facing up at height y.
| arg | type | description |
|---|
| g | Geo | |
| x0 | number | |
| z0 | number | |
| x1 | number | |
| z1 | number | |
| y | number | |
| rect | { number }? | |
box(g: Geo, x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, skip: { [string]: boolean }?) → void
Axis-aligned box. `skip` names faces to leave out: px nx py ny pz nz.
| arg | type | description |
|---|
| g | Geo | |
| x0 | number | |
| y0 | number | |
| z0 | number | |
| x1 | number | |
| y1 | number | |
| z1 | number | |
| skip | { [string]: boolean }? | |
obox(g: Geo, c: V3, ax: V3, ay: V3, az: V3, openFront: boolean?) → void
Oriented box: centre c, half-axis vectors ax, ay, az (right-handed). `openFront` leaves
out the +az face, so a picture or lens laid exactly there is that face (no overlap).
| arg | type | description |
|---|
| g | Geo | |
| c | V3 | |
| ax | V3 | |
| ay | V3 | |
| az | V3 | |
| openFront | boolean? | |
P(sx: number, sy: number, sz: number) → V3
| arg | type | description |
|---|
| sx | number | |
| sy | number | |
| sz | number | |
beam(g: Geo, a: V3, b: V3, w: number, h: number, up: V3?) → void
Rectangular beam from a to b, w wide and h tall (h measured along `up`).
| arg | type | description |
|---|
| g | Geo | |
| a | V3 | |
| b | V3 | |
| w | number | |
| h | number | |
| up | V3? | |
tube(g: Geo, a: V3, b: V3, r: number, segs: number, caps: boolean?, smooth: boolean?) → void
Round tube from a to b.
| arg | type | description |
|---|
| g | Geo | |
| a | V3 | |
| b | V3 | |
| r | number | |
| segs | number | |
| caps | boolean? | |
| smooth | boolean? | |
ring(k: number) → V3
| arg | type | description |
|---|
| k | number | |
append(g: Geo, o: Geo) → void
Merge another geometry into g.
| arg | type | description |
|---|
| g | Geo | |
| o | Geo | |
xformY(g: Geo, from: number, yawDeg: number, off: V3) → void
Translate / rotate-about-Y every vertex added since `from` (vertex index).
| arg | type | description |
|---|
| g | Geo | |
| from | number | |
| yawDeg | number | |
| off | V3 | |
write(dir: string, name: string, g: Geo) → any
| arg | type | description |
|---|
| dir | string | |
| name | string | |
| g | Geo | |