ShoreGeo
Bake-time geometry kit for tropicalProps' shore generators (`ShoreRocks`, `ShoreSea`, `ShorePier`): seeded random (`rng`), `fbm`, bent cards (`strip`, `arcSpine`), swept tubes (`tube`, `rod`), geodesic blobs (`blob`), exact convex polytopes (`polytope`, `facetMesh`), skins grown…
ShoreGeo
Bake-time geometry kit for tropicalProps' shore generators (ShoreRocks, ShoreSea, ShorePier): seeded random (rng), fbm, bent cards (strip, arcSpine), swept tubes (tube, rod), geodesic blobs (blob), exact convex polytopes (polytope, facetMesh), skins grown over a solid (skin), flat shading for the lowpoly look (flat), chamfered timber boards (board), discs, grids, toruses and toMesh. Based on alpineProps' GroundKit and forestProps' GroundGeo (MIT). Nothing on the gameplay path requires it.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2ShoreGeo: the bake-time geometry kit of tropicalProps' shore generators (ShoreRocks, ShoreSea, ShorePier). Nothing on the gameplay path requires it. Based on alpineProps' GroundKit (Snowline Pass, MIT), itself following forestProps' GroundGeo (Beechwood Brook, MIT): seeded random, fbm, bent cards, swept tubes, geodesic blobs and an exact convex-polytope builder (a block cut out of a box by planes, flat facets with sharp edges, then subdivided and warped by position-based noise). Shore additions at the end: skins (moss / wet layers grown over a solid), flat shading for the lowpoly look, chamfered timber boards, discs, heightfield grids and toruses (rope). local K = require("~.ShoreGeo") local poly = K.polytope({ 1, 0.6, 0.8 }, planes) -- planes: { {nx,ny,nz,d} } local g = K.facetMesh(poly, { level = 2, disp = fn, color = fn }) local plank = K.board({ 0, -0.025, 1 }, { 1.2, 0.025, 0.1 }, { chamfer = 0.01 }) A Geo is flat arrays in the shape asset.create("mesh") takes. Vertex colour RGB is a tint the material multiplies its albedo by; ALPHA is the sway weight on cards (0 base, 1 tip) and 1 on solid parts.
next(self: any) → number
| arg | type | description |
|---|---|---|
| self | any |
range(self: any, a: number, b: number) → number
| arg | type | description |
|---|---|---|
| self | any | |
| a | number | |
| b | number |
int(self: any, a: number, b: number) → number
| arg | type | description |
|---|---|---|
| self | any | |
| a | number | |
| b | number |
pick(self: any, t: { any }) → any
| arg | type | description |
|---|---|---|
| self | any | |
| t | { any } |
rng(seed: number) → any
A deterministic random stream: r:next() in [0,1), r:range(a,b), r:int(a,b), r:pick(list).
| arg | type | description |
|---|---|---|
| seed | number |
kindSeed(kind: string, variant: number) → number
A seed from a kind name and a variant number.
| arg | type | description |
|---|---|---|
| kind | string | |
| variant | number |
fbm(x: number, y: number, z: number, octaves: number?) → number
Fractal noise, roughly in [-1, 1].
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number | |
| octaves | number? |
norm3(x: number, y: number, z: number) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number |
cross(ax: number, ay: number, az: number, bx: number, by: number, bz: number) → void
| arg | type | description |
|---|---|---|
| ax | number | |
| ay | number | |
| az | number | |
| bx | number | |
| by | number | |
| bz | number |
rot(yaw: number, pitch: number?, roll: number?) → void
Rotation matrix (row-major 3x3) R = Ry(yaw) * Rx(pitch) * Rz(roll).
| arg | type | description |
|---|---|---|
| yaw | number | |
| pitch | number? | |
| roll | number? |
mulv(m: { number }, x: number, y: number, z: number) → void
| arg | type | description |
|---|---|---|
| m | { number } | |
| x | number | |
| y | number | |
| z | number |
new( ) → Geo
tri(g: Geo, a: number, b: number, c: number) → void
| arg | type | description |
|---|---|---|
| g | Geo | |
| a | number | |
| b | number | |
| c | number |
count(g: Geo) → number return
| arg | type | description |
|---|---|---|
| g | Geo |
triCount(g: Geo) → number return
| arg | type | description |
|---|---|---|
| g | Geo |
append(dst: Geo, src: Geo, xf: any?, tint: Vec?, alphaMul: number?, alphaAdd: number?) → Geo
Copy src into dst through a transform { p = offset, r = rot matrix, s = scale (number or vec) }; tint multiplies RGB.
| arg | type | description |
|---|---|---|
| dst | Geo | |
| src | Geo | |
| xf | any? | |
| tint | Vec? | |
| alphaMul | number? | |
| alphaAdd | number? |
recomputeNormals(g: Geo) → Geo
Area-weighted smooth normals rebuilt from the triangles.
| arg | type | description |
|---|---|---|
| g | Geo |
posKey(x: number, y: number, z: number, e: number) → string
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number | |
| e | number |
weldNormals(g: Geo, eps: number?, k: number?) → Geo
Vertices sharing a position (within eps) get the same averaged normal (blend k: 1 = full average).
| arg | type | description |
|---|---|---|
| g | Geo | |
| eps | number? | |
| k | number? |
bendNormalsUp(g: Geo, k: number) → Geo
Bend each normal toward +Y by k (0..1): soft, sky-lit shading for foliage cards.
| arg | type | description |
|---|---|---|
| g | Geo | |
| k | number |
bounds(g: Geo) → void
Axis-aligned bounds: lo, hi.
| arg | type | description |
|---|---|---|
| g | Geo |
strip(spine: { Vec }, o: any) → Geo
A bent strip card along a spine (GroundGeo.strip). UV u 0..1 across, v 1 at the base .. 0 at the tip (or the crop given); alpha rises base -> tip.
| arg | type | description |
|---|---|---|
| spine | { Vec } | |
| o | any |
arcSpine(len: number, yaw: number, lean: number, droop: number, segs: number) → void
A blade/frond spine rising along yaw, leaning from vertical, arching over toward the tip (segs+1 points).
| arg | type | description |
|---|---|---|
| len | number | |
| yaw | number | |
| lean | number | |
| droop | number | |
| segs | number |
tube(pts: { Vec }, radii: { number }, sides: number, o: any?) → Geo
A swept tube along pts with radii; color(v, a) -> r,g,b,alpha. UV u around, v metres*vScale.
| arg | type | description |
|---|---|---|
| pts | { Vec } | |
| radii | { number } | |
| sides | number | |
| o | any? |
geosphere(level: number) → void
| arg | type | description |
|---|---|---|
| level | number |
mid(a: number, b: number) → number
| arg | type | description |
|---|---|---|
| a | number | |
| b | number |
blob(o: any) → Geo
A geodesic blob: shape(dx,dy,dz) -> x,y,z; color(x,y,z,dx,dy,dz) -> r,g,b,a; UVs planar from above.
| arg | type | description |
|---|---|---|
| o | any |
centroid(pts: { Vec }) → void
| arg | type | description |
|---|---|---|
| pts | { Vec } |
perp(nx: number, ny: number, nz: number) → void
| arg | type | description |
|---|---|---|
| nx | number | |
| ny | number | |
| nz | number |
sortFace(f: Face) → void
| arg | type | description |
|---|---|---|
| f | Face |
box(hx: number, hy: number, hz: number) → void
An axis-aligned box polytope with half extents hx, hy, hz.
| arg | type | description |
|---|---|---|
| hx | number | |
| hy | number | |
| hz | number |
clip(poly: { Face }, nx: number, ny: number, nz: number, d: number) → void
Cut a polytope by the half-space n.p <= d (n unit). Returns the new polytope (unchanged when the plane misses it).
| arg | type | description |
|---|---|---|
| poly | { Face } | |
| nx | number | |
| ny | number | |
| nz | number | |
| d | number |
addCap(p: Vec) → void
| arg | type | description |
|---|---|---|
| p | Vec |
polytope(ext: Vec, planes: { { number } }) → void
A block cut from a box of half extents ext by each plane { nx, ny, nz, d } (normals need not be unit).
| arg | type | description |
|---|---|---|
| ext | Vec | |
| planes | { { number } } |
support(a: number, b: number, c: number, nx: number, ny: number, nz: number) → number
Ellipsoid support distance along unit n for semi-axes a, b, c.
| arg | type | description |
|---|---|---|
| a | number | |
| b | number | |
| c | number | |
| nx | number | |
| ny | number | |
| nz | number |
polyTris(poly: { Face }, level: number) → number
Triangles a polytope makes at a subdivision level (each n-gon is a centroid fan of n triangles, x4 per level).
| arg | type | description |
|---|---|---|
| poly | { Face } | |
| level | number |
transformPoly(poly: { Face }, xf: any) → void
Move a polytope (every point) by a transform { p, r, s }, keeping face normals and planes consistent.
| arg | type | description |
|---|---|---|
| poly | { Face } | |
| xf | any |
facetMesh(poly: { Face }, o: any) → Geo
Mesh a polytope with crisp facets: each face fanned from its centroid, subdivided `level` times, warped by disp(x,y,z) -> dx,dy,dz (position-based, so shared edges stay closed), UVs planar per face (uvScale per metre), normals smooth within a face and softened across edges by `edgeSoft` (0 sharp .. 1 smooth). color(x,y,z,nx,ny,nz,dispMag) -> r,g,b.
| arg | type | description |
|---|---|---|
| poly | { Face } | |
| o | any |
displaced(p: Vec) → void
| arg | type | description |
|---|---|---|
| p | Vec |
mid(a: Vec, b: Vec) → Vec
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec |
canonical(p: Vec) → Vec
| arg | type | description |
|---|---|---|
| p | Vec |
vid(p: Vec) → number
| arg | type | description |
|---|---|---|
| p | Vec |
snowSkin(src: Geo, o: any) → Geo
A snow layer over the upward faces of a solid: triangles whose face normal's Y passes `threshold` (+ noise) are copied, welded, pushed up and out by up to `thick` (thinning to a hairline at the layer's edge). Opts { thick, threshold, seed, noise?, minY? }. Solid (alpha 1), white, UVs planar from above.
| arg | type | description |
|---|---|---|
| src | Geo | |
| o | any |
weld(i: number) → number
| arg | type | description |
|---|---|---|
| i | number |
vert(v: number) → number
| arg | type | description |
|---|---|---|
| v | number |
q(v: number, s: number) → number
| arg | type | description |
|---|---|---|
| v | number | |
| s | number |
toMesh(g: Geo) → void
Flat arrays rounded for small, byte-stable baked files.
| arg | type | description |
|---|---|---|
| g | Geo |
setAlpha(g: Geo, a: number?) → Geo
Set vertex alpha to a (default 1) on every vertex.
| arg | type | description |
|---|---|---|
| g | Geo | |
| a | number? |
shade(g: Geo, fn: (number, number, number, number, number, number) → void
Multiply vertex RGB by fn(x,y,z,nx,ny,nz) -> k (or r,g,b).
| arg | type | description |
|---|---|---|
| g | Geo | |
| fn | (number, number, number, number, number, number |
flat(g: Geo) → Geo
Flat shading (the lowpoly look): every triangle gets its own three vertices carrying the face normal.
| arg | type | description |
|---|---|---|
| g | Geo |
weld(g: Geo, eps: number?) → Geo
Merge vertices sharing a position (within eps) into one (keeps the first's attributes). Use before displacing a mesh built from separate faces.
| arg | type | description |
|---|---|---|
| g | Geo | |
| eps | number? |
skin(src: Geo, mask: (number, number, number, number, number, number) → void
A skin grown over the parts of src where mask(x,y,z,nx,ny,nz) > 0: those triangles copied and pushed out along their normals by up to `thick` (thinner at the mask's edge), RGB tint, alpha 1. A second draw (moss, wet film, algae) on the solid below.
| arg | type | description |
|---|---|---|
| src | Geo | |
| mask | (number, number, number, number, number, number |
vert(i: number) → number
| arg | type | description |
|---|---|---|
| i | number |
board(c: Vec, h: Vec, o: any?) → Geo
A timber board: a box of half extents h centred at c, edges chamfered by `chamfer`, rotated by r (matrix), optionally warped by disp(x,y,z)->dx,dy,dz in board space; UVs run along the board's longest axis (uvScale per metre), color(x,y,z)->r,g,b. Solid (alpha 1).
| arg | type | description |
|---|---|---|
| c | Vec | |
| h | Vec | |
| o | any? |
disc(c: Vec, n: Vec, radius: number, sides: number, col: Vec?, alpha: number?, radiusFn: ((number) → void
A flat disc (n-gon fan) at c facing n, radius r; color r,g,b; alpha a.
| arg | type | description |
|---|---|---|
| c | Vec | |
| n | Vec | |
| radius | number | |
| sides | number | |
| col | Vec? | |
| alpha | number? | |
| radiusFn | ((number |
orient(g: Geo, ref: (number, number, number) → void
Flip any triangle whose face normal disagrees with ref(cx,cy,cz) -> dx,dy,dz.
| arg | type | description |
|---|---|---|
| g | Geo | |
| ref | (number, number, number |
orientToNormals(g: Geo) → number
Make every triangle's winding agree with its vertex normals (the bake's finishing pass). Returns flips.
| arg | type | description |
|---|---|---|
| g | Geo |
grid(cols: number, rows: number, fn: (number, number) → void
A grid surface: cols x rows quads over (u,v) in [0,1]^2, fn(u, v) -> x, y, z, r, g, b. Normals recomputed; front face per `up`(x,y,z) -> direction it should face.
| arg | type | description |
|---|---|---|
| cols | number | |
| rows | number | |
| fn | (number, number |
torus(c: Vec, n: Vec, R: number, r: number, segs: number, sides: number, col: Vec?) → Geo
A torus ring (rope turn) about axis n at c: ring radius R, tube radius r.
| arg | type | description |
|---|---|---|
| c | Vec | |
| n | Vec | |
| R | number | |
| r | number | |
| segs | number | |
| sides | number | |
| col | Vec? |
rod(pts: { Vec }, radii: { number }, sides: number, o: any?) → Geo
A capped tube: K.tube plus discs at both ends.
| arg | type | description |
|---|---|---|
| pts | { Vec } | |
| radii | { number } | |
| sides | number | |
| o | any? |
Geo = { positions: { number }, normals: { number }, uvs: { number }, colors: { number }, indices: { number } }Vec = { number }Face = { n: Vec, d: number, pts: { Vec } }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.