Garden Gate

showcase/garden-gate/

A procedural ledged-and-braced garden gate on hook-and-band hinges through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets — every knuckle on its pin, both pins on one plumb axis, and the swing clearing the latch post — rather than an API contract.

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

witnesses Recomputed: 3936 tris, three materials (timber 434 / iron 1534 / ground 464 faces), 394-tri four-hull collider, LOD ratios 0.50 / 0.22, 1.556 × 0.876 × 1.245 m grounded; the hook-and-band straps lie along the ledges, both knuckles coaxial with their pins (0.000 mm, 0.600 mm running clearance) and seated −0.50 mm on their hooks, both pins plumb on one axis (0.000 mm), swing circle clearing the latch post and keeper by 12.96 mm, both braces rising from the hinge side (0.18 → 0.74 m and 0.22 → 0.70 m from the hinge axis). --skip-decimate exits 9 on LOD1; --stray-vert exits 15 on hygiene; --lift-z exits 16 on grounded zmin; --offset-knuckle exits 17 on the knuckle on its pin; --lift-gate exits 18 on the knuckle seat; --tilt-pintle exits 19 on the plumb shared axis; --tight-post exits 20 on the swing clearance; --reversed-braces exits 21 on the brace direction.

category Village

tags mesh export showcase

blender --background --python showcase/garden-gate/garden_gate.py --

A 900 mm ledged-and-braced garden gate: six vertical oak boards under a bow top, nailed to three back ledges with two diagonal braces between them, hung from a squared hinge post on two hook-and-band hinges whose straps are bolted along the top and bottom ledges, and closing against a latch post. A barrel bolt sits on the middle ledge, a keeper staple on the latch post, a ring pull on the front, and both posts stand in sandstone flags. A showcase piece, not an example — it witnesses no API contract. It asserts that generated geometry meets declared asset budgets, recomputed from the finished mesh.

What it composes#

Shipped contentUsed for
skills/mesh-editing-and-bmeshprisms, revolved knuckles, pins, domes and nail heads, a torus ring, all in one bmesh, chamfered with bmesh.ops.bevel
skills/custom-propertiesface attributes Part (what each shell is) and WoodTone (one tone per board or flag); a point attribute GrainCo (each vertex in its member's own along / across / through frame)
skills/procedural-materials-and-shadersweathered oak with grain along each member, a tone per board and grime toward the ground; black forged iron rusting in patches; sandstone flags
skills/bake-high-to-lowCycles tangent-space normal bake, a 24-segment high onto the 12-segment low
skills/engine-export-presetsUnity glTF (export_yup=True)
skills/depsgraph-and-evaluated-dataevaluated triangle counts for the LOD ratios
snippets/decimate_to_budget.pyLOD1 / LOD2 COLLAPSE chain
snippets/convex_hull_collider.pya hull per post, one over the gate's timber, one over the paving
snippets/lod_chain.pyLOD naming and ratio pattern
examples/mesh-hygiene-audithygiene combinatorics (copied, not imported)

The budget that matters#

A hook-and-band hinge is a rolled eye (the knuckle) on the end of an iron strap, dropped over an upright pin on a hook driven into the post. It can fail without looking wrong:

The piece measures all five off the finished mesh. Every shell carries a Part face attribute written at build time, so the audit finds the two knuckles, the two pins, the two hooks, every member that hangs on the hinges and the latch post with its keeper, without guessing from shape.

--offset-knuckle moves the upper knuckle 1.5 mm off its pin and leaves everything else where it was: exit 17. --tilt-pintle leans the upper pin about the knuckle's mid-height, so its axis still passes through the knuckle and the coaxial budget holds; only plumb fails, exit 19. --tight-post sets the latch post 14 mm closer; the paving defines the envelope, so the AABB does not move, and the swing clearance drops to −1.04 mm: exit 20. --reversed-braces mirrors both braces about the gate's centre line, lower ends at the latch side, on the same ledges and in the same envelope: exit 21.

Budgets#

Declared in the script as named constants, recomputed from the generated mesh. Measured values below are from Blender 5.2.1; see the cross-version table for 4.5.11 and 5.1.2.

BudgetBandMeasured
Base triangles3700–42003936
LOD1 ratio0.32–0.620.5000
LOD2 ratio0.10–0.350.2185
Material slotsexactly 3, distinct3
Timber / iron / ground faces≥ 400 / 1400 / 400434 / 1534 / 464
UV boundsinside 0..1(0.0008, 0.0008)–(0.9992, 0.9992)
UV AABB overlap≤ 1e-50.000000
Outer AABB1.560 × 0.880 × 1.245 m ± 0.0201.5560 × 0.8759 × 1.2450
Collider triangles≤ 400394 (four hulls)
Normal bake{'FINISHED'} with image data{'FINISHED'}, has_data=True
glTF exportfile written, non-empty~332 kB
Hygieneall zeroloose 0/0, non-manifold 0, zero-area 0, doubles 0, n-gons 0, coplanar cross-shell pairs 0
Grounded AABB\zmin\≤ 1e-40.00000
Parts8 flags, 2 posts, 6 boards, 3 ledges, 2 braces, 2 straps, 2 knuckles, 2 pins, 2 hooks, 6 bolt heads, 26 nails, 5 bolt pieces, 1 keeper, 3 ring piecesas stated
Knuckle on pincoaxial ≤ 0.3 mm, clearance 0.3–1.0 mm0.000 mm, 0.600 mm (both hinges)
Knuckle seat−1.0 to −0.2 mm on the hook−0.500 mm (both)
Plumb shared axiseach pin ≤ 0.2 mm, pins ≤ 0.3 mm apart0.000 mm, 0.000 mm
Swing clearance8–30 mm past the latch post and keeper12.96 mm
Brace directioneach brace's upper end ≥ 0.30 m farther from the hinge axis than its lower end0.178 → 0.741 m, 0.215 → 0.703 m
Real-world sizegate 0.900 ± 0.003 × 0.960 ± 0.005, post 1.205 ± 0.005 above its flag, strap 0.400 ± 0.005, pin Ø 12 ± 0.5 mm0.9000 × 0.9599, 1.2050, 0.3995, 12.000 mm

Real-world size: hook-and-band hinges are usually sized at a third of the gate's width, so a 900 mm gate takes 400 × 38 mm straps on 12 mm pins. The gate stands 100 mm clear of the paving, the bow top rising 60 mm from the stiles to the middle board, between 100 mm square posts 1.2 m above the flags.

Construction#

Findings the budgets forced#

Conventions walked#

Every convention in showcase/README.md, and whether it applies here.

ConventionAppliesHow
Deterministic, budgets declared, assertions recomputeyesno RNG; every value above is read off the mesh
Falsifier fails the budget it targetsyestable below
Hygiene incl. cross-shell coplanaryesexit 15
Plumb and real-world sizeyesboth pins plumb on one axis (--tilt-pintle), gate, post, strap and pin sizes; exit 19
A member is tenoned into its seatyesposts into the flags, ledges and straps into the boards, braces into the ledges, the keeper into the post, the hook into the post
Seat conformance (a band: minimum so it cannot float)yeseach knuckle on its hook (--lift-gate), exit 18
Mirrored assembliesnoa gate is handed; nothing is mirrored
Material face floorsyestimber 400, iron 1400, ground 400
One substance, one slotyesoak, forged iron, sandstone
Shading is part of the modelyestimber and flags faceted; knuckles, pins, domes, rod and ring smooth, every edge over 35° hard
Edge treatmentyesevery prism chamfered; no separate budget, removing the chamfers moves the triangle band first
Sort bmesh operator inputsyesthe bevel's edge list is sorted by index
The bake cage is narrower than the nearest neighbouryesCAGE_EXTRUSION 0.01 m
Level on the stage; stage 60 myesturned about Z only; 60 m floor and wall
Keep a falsifier's envelope stillyesno falsifier moves the AABB; --tight-post moves a post inside the paving
Named supports, wrappers, rope, roofs, vessels, scatter, fastenerspartlyfasteners: nails and bolt heads are counted as parts

Falsifiers#

Each breaks one pipeline stage so a named budget fails. All seven were run on Blender 4.5.11, 5.1.2 and 5.2.1 and exited the declared code.

FlagTarget budgetBreaksExit
--skip-decimateLOD1 ratiodrops the DECIMATE modifiers, LOD1 ratio goes to 1.00009
--stray-vertmesh hygieneadds one loose vertex inside the hinge post15
--lift-zgrounded zminlifts the whole mesh 50 mm16
--offset-knuckleknuckle on pinmoves the upper knuckle 1.5 mm along the gate; clearance −0.90 mm17
--lift-gateknuckle seatlifts everything that hangs 3 mm off the hooks; seat +2.50 mm18
--tilt-pintleplumb shared axisleans the upper pin 3.4° about the knuckle's mid-height; top 3.96 mm off its foot19
--tight-postswing clearancesets the latch post 14 mm closer; clearance −1.04 mm20
--reversed-bracesbrace directionmirrors both braces, lower ends at the latch side; brace 0 rises 0.741 → 0.178 m21

Exit codes#

File-local and sequential. 9 is a valid check code. 1 is the FATAL wrapper — a crash, never a named check.

CodeMeaning
0Success
1Uncaught exception (FATAL wrapper)
2argparse / usage
3Mesh did not build, has no UV layer, or a part count is wrong
4Base triangle count outside band
5Material slots, or a material's face floor
6UVs outside 0..1
7UV AABB overlap above tolerance
8Outer AABB off declared size
9LOD1 or LOD2 ratio outside band (--skip-decimate)
10Framing gate (examples/gallery_framing.py, render path only)
11Collider triangles above ceiling
12Normal bake failed or produced no image data
13glTF export missing or empty
14--output produced no file
15Mesh hygiene (--stray-vert)
16Grounded zmin (--lift-z)
17Knuckle off its pin or bore clearance out of band (--offset-knuckle)
18Knuckle seat on its hook (--lift-gate)
19Pin plumb, shared hinge axis or real-world size (--tilt-pintle)
20Swing clearance at the latch post (--tight-post)
21A brace does not rise from the hinge side (--reversed-braces)
24Asset-quality floors (examples/gallery_asset_quality.py, render path only)

Run it#

# Budget check, no render. A few seconds warm.
blender --background --python garden_gate.py --

# Falsifier: the latch post 14 mm closer. Must exit 20.
blender --background --python garden_gate.py -- --tight-post

# Falsifier: both braces mirrored, lower ends at the latch side. Must exit 21.
blender --background --python garden_gate.py -- --reversed-braces

# Falsifier: the upper knuckle 1.5 mm off its pin. Must exit 17.
blender --background --python garden_gate.py -- --offset-knuckle

# Render the gallery still (Cycles, 64 samples, denoised).
blender --background --python garden_gate.py -- --output garden_gate.png --engine cycles

Smoke runs the check-only path. It does not pass --output or any falsifier.

Cross-version measurements#

Every default run and every falsifier was run on all three binaries (.scratch/blender-<ver>-windows-x64/blender.exe, reporting 4.5.11 LTS, 5.1.2 and 5.2.1 LTS). Only the DECIMATE counts differ, which is why the LOD gate is a ratio band; every hinge, swing and size value is identical.

Value4.5.115.1.25.2.1
Base triangles393639363936
LOD1 / LOD2 triangles1968 / 8641968 / 8641968 / 860
LOD2 ratio0.21950.21950.2185
Faces timber / iron / ground434 / 1534 / 464434 / 1534 / 464434 / 1534 / 464
Collider triangles394394394
Coaxial, clearance, seat0.000 / 0.600 / −0.500 mmsamesame
Swing clearance12.959 mm12.959 mm12.959 mm
Falsifier exits 9 / 15 / 16 / 17 / 18 / 19 / 20 / 21all as declaredall as declaredall as declared

Source

showcase/garden-gate/garden_gate.py View the script on GitHub →
A weathered oak garden gate swung ajar between square posts on sandstone flags, seen from its braced side: ledges, a Z of braces, black strap hinges on the ledges and a barrel bolt.