JungleGeo
Flat-array mesh kit the jungleProps generators build with (after tropicalProps' VegGeo): vertices, triangles, tubes with parallel-transport frames, leaf blades, polygon leaves, cards, icosphere lumps, Bezier and sag curves, faceting for the lowpoly look, shared LOD bounds, seeded…
JungleGeo
Flat-array mesh kit the jungleProps generators build with (after tropicalProps' VegGeo): vertices, triangles, tubes with parallel-transport frames, leaf blades, polygon leaves, cards, icosphere lumps, Bezier and sag curves, faceting for the lowpoly look, shared LOD bounds, seeded integer random, frame slicing (slice(ms) / tick()) so bakes never freeze the editor, and bake to write a durable .mesh. Tool-time code used by FloraTrees, FloraPlants, FloraMisc, FloraVines and JungleBake.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2JungleGeo: the flat-array mesh kit the jungleProps vegetation generators build with. local G = require("~.JungleGeo") local g = G.new() local a = G.vertex(g, x,y,z, nx,ny,nz, u,v, r,gg,b,a) -- 0-based index G.tri(g, a, b, c) -- counter-clockwise = front G.tube(g, path, { sides = 10, radius = function(i, t) ... end }) G.flatten(g) -- faceted copy (lowpoly look) G.bake("jungleProps.package/meshes/veg/coconut", "coconut_real_v1_l0_husk", g, true) Vertex colour follows the jungleProps mesh contract: RGB is a tint the material multiplies its albedo by; ALPHA is the wind-sway weight on foliage (0 rigid at the base, 1 full sway at the tips). Solid parts are baked with alpha 1 (`solid`). Metres, +Y up, origin at the ground contact.
slice(ms: number?) → void
Turn frame slicing on (ms > 0: yield after that many milliseconds of work) or off (nil). Only call from a task.
| arg | type | description |
|---|---|---|
| ms | number? |
tick( ) → void
Yield the frame now if the current slice is spent (no-op when slicing is off).
new( ) → Geometry
vert(g: Geometry, p: Vec, n: Vec, u: number, v: number, col: Vec, a: number) → number
vertex from vector tables: position p, normal n, uv, colour {r,g,b}, alpha
| arg | type | description |
|---|---|---|
| g | Geometry | |
| p | Vec | |
| n | Vec | |
| u | number | |
| v | number | |
| col | Vec | |
| a | number |
tri(g: Geometry, a: number, b: number, c: number) → void
| arg | type | description |
|---|---|---|
| g | Geometry | |
| a | number | |
| b | number | |
| c | number |
quad(g: Geometry, a: number, b: number, c: number, d: number) → void
| arg | type | description |
|---|---|---|
| g | Geometry | |
| a | number | |
| b | number | |
| c | number | |
| d | number |
triCount(g: Geometry) → number
| arg | type | description |
|---|---|---|
| g | Geometry |
append(dst: Geometry, src: Geometry) → void
| arg | type | description |
|---|---|---|
| dst | Geometry | |
| src | Geometry |
bounds(g: Geometry) → void
| arg | type | description |
|---|---|---|
| g | Geometry |
orient(g: { positions: { number }, normals: { number }, indices: { number } }) → number
Make every triangle's winding agree with its vertex normals (front = counter-clockwise). Returns how many were flipped.
| arg | type | description |
|---|---|---|
| g | { positions: { number }, normals: { number }, indices: { number } } |
solid(g: { colors: { number }? }) → void
Vertex alpha 1 everywhere (RGB kept): the contract for solid parts.
| arg | type | description |
|---|---|---|
| g | { colors: { number }? } |
flatten(g: Geometry) → Geometry
A faceted copy of g: every triangle gets its own three vertices carrying the face normal (turned to the side the original vertex normals faced). The lowpoly look.
| arg | type | description |
|---|---|---|
| g | Geometry |
shareBounds(parts: { any }) → void
Give every part of one prop the same bounds (two unreferenced corner vertices), so MeshLod measures every part as the whole prop and all parts swap LOD together.
| arg | type | description |
|---|---|---|
| parts | { any } |
bake(folder: string, name: string, g: Geometry, solid: boolean?) → any
Write g as a durable .mesh asset at <folder>/<name>.mesh (folder relative to /zero/source), replacing an earlier bake. Winding is made to agree with the normals first; `solid` sets vertex alpha to 1.
| arg | type | description |
|---|---|---|
| folder | string | |
| name | string | |
| g | Geometry | |
| solid | boolean? |
v(x: number, y: number, z: number) → Vec return
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number |
add(a: Vec, b: Vec) → Vec return
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec |
sub(a: Vec, b: Vec) → Vec return
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec |
scale(a: Vec, s: number) → Vec return
| arg | type | description |
|---|---|---|
| a | Vec | |
| s | number |
madd(a: Vec, b: Vec, s: number) → Vec return
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec | |
| s | number |
dot(a: Vec, b: Vec) → number return a
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec |
cross(a: Vec, b: Vec) → Vec
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec |
len(a: Vec) → number return sqrt
| arg | type | description |
|---|---|---|
| a | Vec |
norm(a: Vec) → Vec
| arg | type | description |
|---|---|---|
| a | Vec |
lerp(a: Vec, b: Vec, t: number) → Vec
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec | |
| t | number |
rotate(v: Vec, k: Vec, angle: number) → Vec
Rotate v about unit axis k by angle (Rodrigues).
| arg | type | description |
|---|---|---|
| v | Vec | |
| k | Vec | |
| angle | number |
perp(v: Vec) → Vec
| arg | type | description |
|---|---|---|
| v | Vec |
dir(az: number, el: number) → Vec
Unit direction from azimuth (radians, 0 = +Z, pi/2 = +X) and elevation above horizontal (radians).
| arg | type | description |
|---|---|---|
| az | number | |
| el | number |
rng(seed: number) → Rng
| arg | type | description |
|---|---|---|
| seed | number |
rand(r: Rng) → number
| arg | type | description |
|---|---|---|
| r | Rng |
range(r: Rng, a: number, b: number) → number
| arg | type | description |
|---|---|---|
| r | Rng | |
| a | number | |
| b | number |
hash(s: string) → number
| arg | type | description |
|---|---|---|
| s | string |
noise1(x: number, seed: number) → number
Smooth 1D value noise in [-1,1].
| arg | type | description |
|---|---|---|
| x | number | |
| seed | number |
h(n: number) → number
| arg | type | description |
|---|---|---|
| n | number |
frames(path: { Vec }, firstNormal: Vec?) → void
Parallel-transport frames along a polyline: tangents T, normals N, binormals B, and arc length s (metres) at each point.
| arg | type | description |
|---|---|---|
| path | { Vec } | |
| firstNormal | Vec? |
along(path: { Vec }, S: { number }, t: number) → void
Point and tangent at fraction t (0..1, by arc length) along a polyline.
| arg | type | description |
|---|---|---|
| path | { Vec } | |
| S | { number } | |
| t | number |
tube(g: Geometry, path: { Vec }, o: TubeOpts) → void
A tube along a polyline with parallel-transport frames. UVs: u wraps the ring (uTiles per revolution), v = metres along / vScale. Returns ring vertex indices.
| arg | type | description |
|---|---|---|
| g | Geometry | |
| path | { Vec } | |
| o | TubeOpts |
cap(i: number, dirSign: number) → void
| arg | type | description |
|---|---|---|
| i | number | |
| dirSign | number |
blade(g: Geometry, spine: { Vec }, side: { Vec }, up: { Vec }, width: (t: number) → void
A leaf blade along a spine: `width(t)` gives the half-width at t (0 base .. 1 tip), `side[i]` the across direction at node i, `fold` lifts the edges (negative droops them) relative to `up[i]`. UVs: u 0..1 across (midrib at 0.5), v 0 base -> 1 tip. Alpha from `alpha(t)`. Returns triangles added.
| arg | type | description |
|---|---|---|
| g | Geometry | |
| spine | { Vec } | |
| side | { Vec } | |
| up | { Vec } | |
| width | (t: number |
icosphere(subdiv: number) → void
Unit icosphere: vertices and 1-based faces wound outward. subdiv 0..3.
| arg | type | description |
|---|---|---|
| subdiv | number |
mid(a: number, b: number) → number
| arg | type | description |
|---|---|---|
| a | number | |
| b | number |
lump(g: Geometry, c: Vec, r: Vec, subdiv: number, col: Vec, a: number, wob: number, seed: number, flatBottom: number?) → number
A lumpy blob (icosphere) at c with radii r, `wob` noise amount, flat-ish bottom when `flatBottom` (0..1 squashes below centre). Normals outward. Returns triangles added.
| arg | type | description |
|---|---|---|
| g | Geometry | |
| c | Vec | |
| r | Vec | |
| subdiv | number | |
| col | Vec | |
| a | number | |
| wob | number | |
| seed | number | |
| flatBottom | number? |
card(g: Geometry, p: Vec, up: Vec, f: Vec, w: number, h: number, col: Vec, a0: number, a1: number, centre: Vec?, fold: number?) → number
A two-triangle card from base point p, growing along `up` for h, `w` wide across right = up x f, facing f. UV u 0..1 across, v 0 base -> 1 tip. Normals bend outward from `centre` when given (soft crown shading). Returns the first vertex index.
| arg | type | description |
|---|---|---|
| g | Geometry | |
| p | Vec | |
| up | Vec | |
| f | Vec | |
| w | number | |
| h | number | |
| col | Vec | |
| a0 | number | |
| a1 | number | |
| centre | Vec? | |
| fold | number? |
nrm(q: Vec) → Vec
| arg | type | description |
|---|---|---|
| q | Vec |
bezier(p0: Vec, p1: Vec, p2: Vec, p3: Vec, n: number) → void
Cubic Bezier sampled to n+1 points.
| arg | type | description |
|---|---|---|
| p0 | Vec | |
| p1 | Vec | |
| p2 | Vec | |
| p3 | Vec | |
| n | number |
sagCurve(a: Vec, b: Vec, sag: number, n: number, wob: number?, seed: number?) → void
A sagging catenary-like curve from a to b with mid-span drop `sag`, n+1 points; `wob` adds a seeded sideways wander.
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec | |
| sag | number | |
| n | number | |
| wob | number? | |
| seed | number? |
toMeshData(g: Geometry) → void
Geometry to the table renderer.mesh.create / asset.create("mesh") take.
| arg | type | description |
|---|---|---|
| g | Geometry |
Geometry = {Vec = { number }Rng = { s: number }TubeOpts = {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.