preseed/hedge.module — procedural hedge-fence generator.
Sweeps a noise-displaced superellipse foliage section along a polyline or
elliptical-arc centerline: parterre ribbons, tall bosquet walls,
pier-and-finial hedge fences, and freestanding clipped topiary (balls,
cones, spirals). Pure geometry — every builder returns Geo-style flat
arrays ({ positions, normals, uvs, indices }) ready for Geo.mesh /
Geo.merge; render with the preseed.shaders.hedge_leaf material for
clipped-foliage shading. UVs carry (arclength m, height fraction).
M.geom(spec) — a hedge run
path { {x, z} | {x, y, z}, ... } centerline (y = ground height)
ellipse { a, b, t0?, t1? } elliptical-arc centerline (alternative
to path; omitted t0/t1 close the full ring)
height, width foliage size (m)
boxiness 0 = domed section, 1 = crisp trimmed box (default 0.65)
taper top inset fraction of the half-width (default 0.12)
crown "flat" | "scallop" | "crenel" | "billow" (default "flat")
crownDepth crown modulation as a fraction of height (default 0.22)
crownPeriod scallop/crenel wavelength in meters (default 4 * width)
meander lateral low-frequency drift amplitude (m, default 0)
noise { amp?, scale? } leaf-cluster displacement
res station spacing (m, default width * 0.45)
sectionPoints points across the section arch (default 13)
seed deterministic variation seed
piers { every?, atEnds?, width?, height?, length?,
finial = "ball" | "cone"? } pilaster masses along the run
M.topiary(spec) — a freestanding clipped specimen, base at y = 0
kind "ball" | "cone" | "spiral"
r radius (m); h — height (cone/spiral only)
noise, seed as above
nhash(x: ?, y: ?, z: ?, seed: ?) → void
| arg | type | description |
|---|
| x | ? | |
| y | ? | |
| z | ? | |
| seed | ? | |
vnoise3(x: ?, y: ?, z: ?, seed: ?) → void
| arg | type | description |
|---|
| x | ? | |
| y | ? | |
| z | ? | |
| seed | ? | |
lerp(a: ?, b: ?, t: ?) → void
| arg | type | description |
|---|
| a | ? | |
| b | ? | |
| t | ? | |
fbm3(x: ?, y: ?, z: ?, seed: ?) → void
| arg | type | description |
|---|
| x | ? | |
| y | ? | |
| z | ? | |
| seed | ? | |
sstep(e0: ?, e1: ?, x: ?) → void
| arg | type | description |
|---|
| e0 | ? | |
| e1 | ? | |
| x | ? | |
buildStations(spec: ?, step: ?) → void
Fine-sample the spec's centerline, then resample at even arclength steps.
Returns stations { {x, y, z, tx, tz, s}, ... } (tangent XZ-normalized,
s = arclength) and whether the run is closed.
| arg | type | description |
|---|
| spec | ? | |
| step | ? | |
gridNormals(P: ?, wrapI: ?, wrapJ: ?) → void
Central-difference normals for a grid P[i][j] = {x, y, z}.
| arg | type | description |
|---|
| P | ? | |
| wrapI | ? | |
| wrapJ | ? | |
emitGrid(out: ?, P: ?, N: ?, UV: ?, wrapI: ?, wrapJ: ?) → void
Append a grid to out. uvs[i][j] = {u, v}. Winding is self-checked against
the grid normals so emitted faces always look outward.
| arg | type | description |
|---|
| out | ? | |
| P | ? | |
| N | ? | |
| UV | ? | |
| wrapI | ? | |
| wrapJ | ? | |
emitCap(out: ?, ring: ?, cx: ?, cy: ?, cz: ?, dirx: ?, diry: ?, dirz: ?, us: ?) → void
Flat fan closing one end of an open run: ring of grid points + centroid,
wound to face `dir`.
| arg | type | description |
|---|
| out | ? | |
| ring | ? | |
| cx | ? | |
| cy | ? | |
| cz | ? | |
| dirx | ? | |
| diry | ? | |
| dirz | ? | |
| us | ? | |
loft(out: ?, st: ?, closed: ?, p: ?) → void
Sweep the superellipse foliage section along stations into out.
p: { height, width, expo, taper, njs, noiseAmp, noiseScale, seed,
hf?, wf?, mx?, mz? } (per-station factor arrays optional)
| arg | type | description |
|---|
| out | ? | |
| st | ? | |
| closed | ? | |
| p | ? | |
emitBall(out: ?, r: ?, seed: ?, amp: ?, scale: ?, squash: ?) → void
Noise-displaced sphere for finials and ball topiary; center at origin.
| arg | type | description |
|---|
| out | ? | |
| r | ? | |
| seed | ? | |
| amp | ? | |
| scale | ? | |
| squash | ? | |
translate(out: ?, from: ?, dx: ?, dy: ?, dz: ?) → void
| arg | type | description |
|---|
| out | ? | |
| from | ? | |
| dx | ? | |
| dy | ? | |
| dz | ? | |