Palm Tree

showcase/palm-tree/

A procedural coconut palm on a raised disc of rippled beach sand — a trunk that rises from a swollen, lobed bole with a mat of roots flaring out of it into the sand, leans away along a curve and comes back upright under the crown, tapering, ringed with leaf scars at an even pitch; a fibrous boss of leaf bases carrying eighteen pinnate fronds in a golden-angle spiral, each a curved, drooping rachis with 36 pairs of folded leaflets hanging below it in a V, the young fronds high and rising, the old ones low and hanging; two dead brown fronds against the trunk, two unopened spear leaves, and bunches of green and ripening coconuts under the frond bases; two fallen coconuts, a fallen frond, a driftwood branch, seashells and sea grass — through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.

Rendered headless by the showcase piece itself. Select it to enlarge.

witnesses Recomputed: 45196 tris, eight materials with 3694 sand, 4752 bark, 14828 frond, 1243 dead frond, 1344 husk, 846 shell, 146 driftwood and 1118 grass faces, UVs in 0..1 with zero AABB overlap, outer AABB 5.265×5.150×6.026 m read off the vertices, zmin 0, hygiene 0 including zero coplanar cross-shell pairs, all 22 fronds and spears seated 0.0871–0.1217 m in the boss (band 0.060–0.160), all 12 coconuts biting 0.0229–0.0297 m into it (band 0.012–0.045) below its centre, the trunk 4.4735 m tall (4.47 ± 0.05) with its crown 0.8056 m off the foot (band 0.60–1.00) and the mass centre of trunk and crown 0.2081 m inside the root plate of 24 roots (min 0.080), 25 leaf-scar rings at a 0.14498 m pitch with a 0.00136 m spread (cap 0.006), the trunk bedded 0.0990 m (band 0.030–0.200) and root tips 0.0644–0.0716 m (band 0.020–0.100) under the sand, the fallen coconuts resting 0.0198–0.0207 m into it (band 0.010–0.050), all 1566 shells joined to the sand, LOD ratios in band, trunk collider 44 tris, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z 16; --short-petioles 17; --drop-coconut 18; --short-roots 19; --bunch-rings 20; --perch-trunk 21; --float-nuts 22; --float-cover 23.

category Nature

tags mesh export showcase

blender --background --python showcase/palm-tree/palm_tree.py --

A showcase piece, not an example, and the sixth in the nature category. It builds a procedural, game-ready coconut palm on a raised disc of beach sand:

Every seeded draw comes from random.Random(SEED) in plan_beach(), before anything is built. Per-leaflet variety (droop, forward angle, length, bend, twist, tone, which dead leaflets are missing) comes from a closed-form hash of the leaflet's indices, so no flag can shift it.

Eight materials, one per substance: sand, palm bark (trunk, rings, roots and the boss of leaf bases, told apart by a face zone), live frond (leaflets, rachis and spears), dead frond (the hanging and fallen fronds), coconut husk (green, ripening and dry), seashell, driftwood and sea grass. A point attribute Along carries the run along the trunk, a rachis, a leaflet, a root or a nut, and Skirt marks the disc's cut edge; a Tone face attribute is seeded per part. Everything is smooth-shaded; every material boundary and every fold sharper than 62° is a hard edge, so a leaflet's edges and a shell's rim stay crisp while a six-sided rachis stays round, and 30° on the coconuts, so the husk's three ridges read as facets.

It asserts budget conformance of the generated result. It does not witness an API contract. "It rendered without error" is not a check.

Composes skills mesh-editing-and-bmesh, bake-high-to-low, depsgraph-and-evaluated-data, engine-export-presets, and snippets bake_normal_high_to_low.py, setup_bake_target_image.py, lod_chain.py / decimate_to_budget.py, convex_hull_collider.py, export_preset_unity.py (helpers copied inline, not imported).

Intended size: a disc 3.1 × 2.8 m, the palm 6.03 m to the tip of its highest frond. The outer AABB is 5.2645 × 5.1503 × 6.0258 m, read off the vertices: the fronds set X, Y and the top; the sand's underside is the ground. The collider is the convex hull of the lower 2.4 m of the trunk, coarse: players walk the sand and brush through the fronds, but not through the bole.

Budgets#

Every budget is declared as a named constant. Every gate recomputes its value from the mesh, materials, UVs, evaluated LOD, collider, or export file.

AxisDeclaredMeasured (5.2.1)
Base triangles44600–4580045196
LOD1 ratio0.32–0.62 of base0.5000
LOD2 ratio0.10–0.35 of base0.2200
Materialsexactly 8 distinct; ≥3400 sand, ≥4370 bark, ≥13640 frond, ≥1140 dead frond, ≥1230 husk, ≥780 shell, ≥134 driftwood, ≥1030 grass faces8 slots; 3694 / 4752 / 14828 / 1243 / 1344 / 846 / 146 / 1118
UVsin 0..1, AABB overlap ≤ 1e-5in range, overlap 0
Outer AABB(5.2645, 5.1503, 6.0258) m ± 0.01(5.2645, 5.1503, 6.0258), zmin 0
Collider tris (lower trunk hull)≤ 6044
Exportwritten, size > 0, removed after measuring3518264 / 3518264 / 3518252 bytes (4.5.11 / 5.1.2 / 5.2.1)

No falsifier changes the triangle count: every falsifier run measured 45196 tris. None moves the envelope by more than 0.1 mm.

DECIMATE COLLAPSE triangle counts are not identical across Blender series, so the LOD gate is a ratio band, not an exact count. Bake pixels are stochastic, so the bake gate is has_data plus operator FINISHED, not byte-identity. The plan is seeded and nothing else is random; the geometry is pure Python math. Two default runs print identical measurements.

Hygiene#

Recomputed from the generated mesh, not asserted about the script.

AxisDeclaredMeasured
Non-manifold edges00
Loose verts / edges0 / 00 / 0
Doubles merged at 1e-500
Zero-area faces00
N-gons00
Coplanar cross-shell face pairs (KD range 0.05 m, plane ε 1e-4)00
Grounded: zminwithin 1e-4 of 00.0000

The fallen frond's leaflets lie flat on the sand and overlap their neighbours, and on the first build two of them shared a plane. They are staggered in height by a millimetre in a four-step cycle, and spaced so a leaflet clears the next one on its side of the rachis, rather than widening any band.

Fronds, coconuts, the trunk, the rings, the bedding and the cover#

These are the organic invariants. A palm has no joinery, but it is jointed all the same: every frond grows out of the crown and every coconut hangs from it. The trunk leans, but the crown's mass has to stand over what holds it; the leaf scars come at the pitch the palm grew at; and the palm and what the sea left stand in the sand, not on it.

AxisDeclaredMeasured
Fronds seated: every rachis, dead frond and spear, its deepest vertex inside the boss of leaf bases (ray parity by majority of three directions, distance to the nearest face)22 fronds, each 0.060–0.160 m22; 0.0871–0.1217 m
Coconuts attached: every nut on the crown, its deepest vertex inside the boss, and its centre below the boss's centre12 nuts, each 0.012–0.045 m, each below12; 0.0229–0.0297 m; 0.117–0.183 m below
Trunk: its height from the sand at its foot to its top; the crown's offset, a top slab's centroid off a slab's 0.55–0.75 m over the sand; the tip-over margin: the volume centroid of every closed shell of trunk and crown (uniform density) inside the root plate, the hull in plan of where each root enters the sand, by at least a marginheight 4.47 ± 0.05 m; offset 0.60–1.00 m; 24 roots; margin ≥ 0.080 m4.4735 m; 0.8056 m; mass centre 0.5555 m off the foot, 0.2081 m inside a plate reaching 0.3846–0.8047 m
Rings: the 25 leaf-scar ring shells, the distance between consecutive ring centroids up the trunk25 rings; mean pitch 0.135–0.155 m; spread ≤ 0.006 m25; 0.14498 m; 0.00136 m
Bedding: the trunk's most-buried vertex in each of eight sectors round its foot, under the sand straight above it, the shallowest sector; every root's deepest point under the sandtrunk 0.030–0.200 m; roots 0.020–0.100 m0.0990 m; 0.0644–0.0716 m
Resting: each fallen coconut's lowest vertex under the sand straight above it2 nuts, each 0.010–0.050 m0.0198–0.0207 m
Cover joined: every shell unioned with the sand through BVH overlapsevery shell joined1566 shells; 0 loose

Two measurements needed care. A nut hung from the boss leans out and down, and the boss curves away under it, so seating the stem end a fixed depth along the nut's axis buried the nut's shoulder 0.107 m deep. Each nut is slid out along its own axis until its deepest point is the design bite. And one parity ray grazing an edge of the boss counted it twice, which put a vertex 0.108 m outside the boss "inside" it; every inside test is now a majority of three rays in different directions.

The tip-over budget is what makes the lean honest. The crown stands 0.81 m off the foot, and the trunk's own volume leans with it, so the mass centre sits 0.56 m off the foot, well outside the bole. The palm stands because its roots reach furthest on the side it leans toward.

Falsifiers#

Each falsifier violates one named budget. Every one was run on 5.2.1 and exited its declared code, and the budget_fails line it prints names only its own budget.

FlagBudget violatedExit
--skip-decimateLOD1 ratio band (measured 1.0000)9
--stray-vertloose vertex count is 0 (measured 1, placed inside the envelope)15
--lift-zbounding box zmin is 0 (measured 0.05000)16
--short-petiolesfronds seated (every rachis and spear starts 80 mm nearer the boss's skin, still inside it: 0.0175–0.0422 m)17
--drop-coconutcoconuts attached (one nut slid out along its axis until 6 mm of it is in the boss, still touching: 0.0037 m)18
--short-rootstip-over margin (every root dives in 0.26 m from the axis: the plate reaches 0.2059–0.3502 m and the mass centre is 0.3507 m outside it)19
--bunch-ringsrings at an even pitch (three rings slid 45 mm down the trunk, still on the bark: spread 0.08992 m)20
--perch-trunkbedding (the trunk's foot 12 mm under the sand, the roots unchanged: shallowest sector 0.0123 m)21
--float-nutsresting (the fallen coconuts raised 16 mm, still touching the sand: 0.0038–0.0047 m)22
--float-covercover joined (shells, driftwood, sea grass and the fallen frond lifted 50 mm: 120 of 1566 shells loose)23

Each falsifier moves only what its budget measures, and none is sized past the point where a second budget would see it. --short-petioles trims each rachis at its base and leaves the rest of the frond where it was, so the envelope and the leaflets do not move. --drop-coconut leaves the nut touching the boss and --float-nuts leaves the nuts touching the sand, so the cover stays joined. --short-roots keeps every root seated in the bole and bedded at its tip. --perch-trunk raises only the bottom of the bole: the axis above the sand, the rings, the roots and the crown do not move.

Run#

blender --background --python palm_tree.py --
blender --background --python palm_tree.py -- --skip-decimate
blender --background --python palm_tree.py -- --stray-vert
blender --background --python palm_tree.py -- --lift-z
blender --background --python palm_tree.py -- --short-petioles
blender --background --python palm_tree.py -- --drop-coconut
blender --background --python palm_tree.py -- --short-roots
blender --background --python palm_tree.py -- --bunch-rings
blender --background --python palm_tree.py -- --perch-trunk
blender --background --python palm_tree.py -- --float-nuts
blender --background --python palm_tree.py -- --float-cover
blender --background --python palm_tree.py -- --output palm.png

Smoke passes no flags.

The hero keeps the piece unturned (HERO_YAW_DEG 0°) and looks in from the south-south-west, a little above the disc, so the trunk leans to the right across the frame and the crown's fronds spread both ways. The fill is 0.394 × 0.867.

Exit codes#

File-local. 9 is a valid check code. 10 is reserved for gallery_framing.check_framing on the --output path. 15–19 are the hygiene, grounding, joint, seat and plumb family. 20–23 are file-local. 24 is the asset-quality floor on the render path: check_asset_quality returns 11, which this piece already spends on the collider ceiling, so the call site remaps it.

CodeMeaning
0Success
1Uncaught exception (FATAL wrapper)
2argparse / usage
3Mesh did not build, no UV layer, or no sand, trunk or boss shell
4Base triangle count outside range
5Material count ≠ 8 distinct slots, or a face-count floor missed
6UVs outside 0..1
7UV AABB overlap above tolerance
8World AABB off declared outer size
9LOD ratio band (--skip-decimate lands here)
10Framing gate (render path only)
11Collider triangle count above ceiling
12Bake did not finish or image has no data
13Export file missing or empty
14--output produced no file
15Mesh hygiene: loose, non-manifold, zero-area, doubles, n-gons, coplanar cross-shell pairs
16Not grounded: bounding box zmin off 0 (--lift-z)
17Fronds: not 22 rachises and spears, or one's deepest vertex inside the boss outside 0.060–0.160 m (--short-petioles)
18Coconuts: not 12 on the crown, a nut's deepest vertex inside the boss outside 0.012–0.045 m, or a nut not below the boss's centre (--drop-coconut)
19Trunk: height off 4.47 ± 0.05 m, crown offset outside 0.60–1.00 m, not 24 roots, or the mass centre less than 0.080 m inside the root plate (--short-roots)
20Rings: not 25, mean pitch outside 0.135–0.155 m, or a spread above 0.006 m (--bunch-rings)
21Bedding: the trunk's shallowest sector outside 0.030–0.200 m under the sand, or a root tip outside 0.020–0.100 m (--perch-trunk)
22Resting: a fallen coconut's lowest point outside 0.010–0.050 m under the sand (--float-nuts)
23Cover: a shell not joined to the sand (--float-cover)
24Asset-quality floor (render path only; remapped from 11)

Source

showcase/palm-tree/palm_tree.py View the script on GitHub →
A coconut palm leaning on a raised disc of beach sand: a ringed, curving trunk, a crown of drooping pinnate fronds over green coconuts, and fallen coconuts, a frond, driftwood and grass below.