Skip to content

Commit a3aac9d

Browse files
fix: rebuild hay-bale and hitching-post so the joints actually meet (#170)
* fix: rebuild hay-bale as a cinched bound loaf Solid square-torus belts snap to belt-local loops so the strap cinches the pillow instead of framing a cube, and hygiene budgets lock the joints. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * fix: rebuild hitching-post joints as real parts Cap, arm, shoe, and rings are derived from the post faces so they meet instead of overlapping boxes, and hygiene budgets lock the contacts. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * docs: require hygiene budgets on every showcase piece Copied mesh-hygiene-audit combinatorics, grounded zmin, and BVH contact gaps are now conventions so the next visual pass inherits them. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> --------- Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6be7daf commit a3aac9d

13 files changed

Lines changed: 1313 additions & 324 deletions

File tree

612 Bytes
Loading
1.94 KB
Loading

‎docs/gallery/hay-bale/index.html‎

Lines changed: 332 additions & 73 deletions
Large diffs are not rendered by default.

‎docs/gallery/hitching-post/index.html‎

Lines changed: 298 additions & 78 deletions
Large diffs are not rendered by default.

‎docs/gallery/index.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,12 +1052,12 @@ <h2><a href="water-trough/">water-trough</a></h2>
10521052
</article>
10531053
<article class="card" data-tags="mesh export showcase">
10541054
<a class="card-media" href="hitching-post/" aria-label="hitching-post example detail page">
1055-
<img src="assets/hitching-post-hero.webp" alt="hitching-post — A procedural hitching post through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract." loading="lazy" decoding="async" />
1055+
<img src="assets/hitching-post-hero.webp" alt="hitching-post — A procedural hitching post (corner-aligned cap, stub-and-tenon arm, collar shoe, eye-threaded rings) through UVs, bake, LOD, collider, and Unity glTF…" loading="lazy" decoding="async" />
10561056
</a>
10571057
<div class="card-body">
10581058
<h2><a href="hitching-post/">hitching-post</a></h2>
1059-
<p class="teaches">A procedural hitching post through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
1060-
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 848 tris, two materials with 262 metal faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.460×0.194×1.260 m, LOD ratios in band (5.2 COLLAPSE more aggressive on LOD2), convex collider 144 tris, non-empty glTF. --skip-decimate exits 9 on the LOD1 ratio budget.</p>
1059+
<p class="teaches">A procedural hitching post (corner-aligned cap, stub-and-tenon arm, collar shoe, eye-threaded rings) through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
1060+
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 1598 tris, two materials with 269 wood and 532 metal faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.460×0.191×1.258 m, zmin 0, hygiene 0, wood-metal BVH gap 0.45 mm, LOD ratios in band, convex collider 78 tris, non-empty glTF. --skip-decimate exits 9 on LOD1; --lift-z exits 16 on grounded zmin.</p>
10611061
<a class="card-link" href="hitching-post/">View example <span aria-hidden="true">&rarr;</span></a>
10621062
</div>
10631063
</article>
@@ -1162,12 +1162,12 @@ <h2><a href="wooden-ladder/">wooden-ladder</a></h2>
11621162
</article>
11631163
<article class="card" data-tags="mesh export showcase">
11641164
<a class="card-media" href="hay-bale/" aria-label="hay-bale example detail page">
1165-
<img src="assets/hay-bale-hero.webp" alt="hay-bale — A procedural bound hay bale with a bevelled loaf, end nap, and two sisal twine belts through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed…" loading="lazy" decoding="async" />
1165+
<img src="assets/hay-bale-hero.webp" alt="hay-bale — A procedural bound hay bale with a cinched pillow loaf, end nap, and two sisal twine belts through UVs, bake, LOD, collider, and Unity glTF, asserting…" loading="lazy" decoding="async" />
11661166
</a>
11671167
<div class="card-body">
11681168
<h2><a href="hay-bale/">hay-bale</a></h2>
1169-
<p class="teaches">A procedural bound hay bale with a bevelled loaf, end nap, and two sisal twine belts through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
1170-
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 252 tris, two materials with 66 hay and 60 twine faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.916×0.520×0.401 m, LOD ratios in band (5.2 COLLAPSE more aggressive), convex collider 68 tris, non-empty glTF. --skip-decimate exits 9 on the LOD1 ratio budget.</p>
1169+
<p class="teaches">A procedural bound hay bale with a cinched pillow loaf, end nap, and two sisal twine belts through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
1170+
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 852 tris, two materials with 294 hay and 132 twine faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.920×0.517×0.426 m, zmin 0, hygiene 0, hay-twine BVH gap 0.07 mm, LOD ratios in band, convex collider 78 tris, non-empty glTF. --skip-decimate exits 9 on LOD1; --lift-z exits 16 on grounded zmin.</p>
11711171
<a class="card-link" href="hay-bale/">View example <span aria-hidden="true">&rarr;</span></a>
11721172
</div>
11731173
</article>

‎showcase/README.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@ entry in `showcase/gallery.json`, and a rendered still.
3333
assigned `DECLARED` is not a check).
3434
- **Falsifier** breaks one pipeline stage so a **named** budget fails and
3535
the piece exits its documented code. Prove default and falsifier on
36-
4.5.11, 5.1.2, and 5.2.1.
36+
4.5.11, 5.1.2, and 5.2.1. `--skip-decimate` is the LOD-ratio
37+
falsifier (exit 9). `--lift-z` is the grounded-zmin falsifier (exit 16).
38+
- **Hygiene budgets.** Copied combinatorics from
39+
`examples/mesh-hygiene-audit` (do not import the example). Every piece
40+
asserts on the generated mesh: non-manifold edges 0, loose verts 0,
41+
loose edges 0, doubles at 1e-5 0, zero-area faces 0, n-gons 0, world
42+
AABB min Z within 1e-4 of 0. Multi-body props do **not** require Euler
43+
characteristic 2 — that is a single-shell contract. Pairs of parts
44+
meant to touch assert a BVH surface gap below a named epsilon
45+
(vert-vert is the wrong metric for thin straps and collars).
3746
- **Exit codes** are file-local: `0` success, argparse `2`, `3` and above
3847
in check order. `9` is legal. FATAL `sys.exit(1)` is a crash, never a
3948
named check.

‎showcase/gallery.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@
188188
{
189189
"name": "hitching-post",
190190
"dir": "showcase/hitching-post",
191-
"teaches": "A procedural hitching post through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.",
192-
"witnessesFix": "Recomputed: 848 tris, two materials with 262 metal faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.460×0.194×1.260 m, LOD ratios in band (5.2 COLLAPSE more aggressive on LOD2), convex collider 144 tris, non-empty glTF. --skip-decimate exits 9 on the LOD1 ratio budget.",
191+
"teaches": "A procedural hitching post (corner-aligned cap, stub-and-tenon arm, collar shoe, eye-threaded rings) through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.",
192+
"witnessesFix": "Recomputed: 1598 tris, two materials with 269 wood and 532 metal faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.460×0.191×1.258 m, zmin 0, hygiene 0, wood-metal BVH gap 0.45 mm, LOD ratios in band, convex collider 78 tris, non-empty glTF. --skip-decimate exits 9 on LOD1; --lift-z exits 16 on grounded zmin.",
193193
"hero": "docs/gallery/assets/hitching-post-hero.webp",
194194
"preview": "showcase/hitching-post/preview.webp",
195195
"tags": [
@@ -308,8 +308,8 @@
308308
{
309309
"name": "hay-bale",
310310
"dir": "showcase/hay-bale",
311-
"teaches": "A procedural bound hay bale with a bevelled loaf, end nap, and two sisal twine belts through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.",
312-
"witnessesFix": "Recomputed: 252 tris, two materials with 66 hay and 60 twine faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.916×0.520×0.401 m, LOD ratios in band (5.2 COLLAPSE more aggressive), convex collider 68 tris, non-empty glTF. --skip-decimate exits 9 on the LOD1 ratio budget.",
311+
"teaches": "A procedural bound hay bale with a cinched pillow loaf, end nap, and two sisal twine belts through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.",
312+
"witnessesFix": "Recomputed: 852 tris, two materials with 294 hay and 132 twine faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.920×0.517×0.426 m, zmin 0, hygiene 0, hay-twine BVH gap 0.07 mm, LOD ratios in band, convex collider 78 tris, non-empty glTF. --skip-decimate exits 9 on LOD1; --lift-z exits 16 on grounded zmin.",
313313
"hero": "docs/gallery/assets/hay-bale-hero.webp",
314314
"preview": "showcase/hay-bale/preview.webp",
315315
"tags": [

‎showcase/hay-bale/README.md‎

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Hay bale
22

3-
A showcase piece, not an example. Procedural bound straw bale (bevelled
4-
loaf, end nap, two sisal twine belts) then the shipped pipeline:
5-
unique-cell UVs, Cycles high-to-low normal bake, LOD chain, convex
6-
collider, Unity glTF export.
3+
A showcase piece, not an example. Procedural bound straw bale (cinched
4+
pillow loaf, end nap, two square-torus sisal belts with hitch loops)
5+
then the shipped pipeline: unique-cell UVs, Cycles high-to-low normal
6+
bake, LOD chain, convex collider, Unity glTF export.
77

88
It asserts **budget conformance** of the generated result. It does not
99
witness an API contract. "It rendered without error" is not a check.
@@ -13,6 +13,11 @@ witness an API contract. "It rendered without error" is not a check.
1313
`bake_normal_high_to_low.py`, `setup_bake_target_image.py`,
1414
`lod_chain.py` / `decimate_to_budget.py`, `convex_hull_collider.py`,
1515
`export_preset_unity.py` (helpers copied, not imported as a package).
16+
Hygiene combinatorics match `examples/mesh-hygiene-audit` (copied, not
17+
imported).
18+
19+
Intended size: 0.90 × 0.48 × 0.38 m core loaf; outer AABB includes
20+
cinch bulge and belts.
1621

1722
## Budgets
1823

@@ -21,34 +26,38 @@ materials, UVs, evaluated LOD, collider, or export file.
2126

2227
| Axis | Declared | Measured (4.5.11 / 5.1.2 / 5.2.1) |
2328
| --- | --- | --- |
24-
| Base triangles | 220–290 | 252 / 252 / 252 |
25-
| LOD1 ratio | 0.32–0.62 of base | 0.5000 / 0.5000 / 0.4683 |
26-
| LOD2 ratio | 0.10–0.35 of base | 0.2143 / 0.2143 / 0.1429 |
27-
| Materials | exactly 2 distinct, ≥24 hay, ≥24 twine | 2 slots, 66 hay, 60 twine |
29+
| Base triangles | 750–1100 | 852 / 852 / 852 |
30+
| LOD1 ratio | 0.32–0.62 of base | 0.5000 / 0.5000 / 0.5000 |
31+
| LOD2 ratio | 0.10–0.35 of base | 0.2183 / 0.2183 / 0.2183 |
32+
| Materials | exactly 2 distinct, ≥24 hay, ≥24 twine | 2 slots, 294 hay, 132 twine |
2833
| UVs | in `0..1`, AABB overlap ≤ 1e-5 | in range, overlap 0 |
29-
| Outer AABB | (0.916, 0.520, 0.401) m ± 0.01 | (0.9160, 0.5200, 0.4010), zmin 0 |
30-
| Collider tris | ≤ 120 | 68 |
31-
| Export | written, size > 0 | 25944 / 25944 / 25936 bytes |
34+
| Outer AABB | (0.920, 0.517, 0.426) m ± 0.01 | (0.9199, 0.5170, 0.4257) |
35+
| Grounded zmin | within 1e-4 of 0 | 0 / 0 / 0 |
36+
| Hygiene | loose/nonman/zero-area/doubles/ngons = 0 | 0 / 0 / 0 |
37+
| Hay–twine gap | BVH surface < 0.008 m | 0.00007 / 0.00007 / 0.00007 |
38+
| Collider tris | ≤ 400 | 78 |
39+
| Export | written, size > 0 | 70720 / 70720 / 70712 bytes |
3240

3341
DECIMATE COLLAPSE triangle counts are **not** identical across series —
34-
5.2.1 is more aggressive on both LOD ratios. The gate is a ratio band,
35-
not an exact count. Bake pixels are stochastic; the gate is `has_data`
36-
plus operator `FINISHED`, not byte-identity. Construction uses no RNG.
37-
Export byte counts differ by 8 B on 5.2.1 (glTF serializer), not a
38-
gated axis.
42+
the gate is a ratio band, not an exact count. Bake pixels are
43+
stochastic; the gate is `has_data` plus operator `FINISHED`, not
44+
byte-identity. Construction uses no RNG. Export byte counts differ by
45+
8 B on 5.2.1 (glTF serializer), not a gated axis.
3946

4047
`--skip-decimate` skips the LOD DECIMATE stage so LOD1 ratio is 1.0 and
41-
exit 9 fires. That is the named budget the falsifier violates.
48+
exit 9 fires. `--lift-z` raises the mesh 5 cm so the grounded-zmin
49+
hygiene budget fails and exit 16 fires.
4250

4351
## Run
4452

4553
```bash
4654
blender --background --python hay_bale.py --
4755
blender --background --python hay_bale.py -- --skip-decimate
56+
blender --background --python hay_bale.py -- --lift-z
4857
blender --background --python hay_bale.py -- --output bale.png
4958
```
5059

51-
Smoke does not pass `--output` or `--skip-decimate`.
60+
Smoke does not pass `--output`, `--skip-decimate`, or `--lift-z`.
5261

5362
## Exit codes
5463

@@ -72,3 +81,6 @@ File-local. `9` is a valid check code. `10` is reserved for
7281
| 12 | Bake did not finish or image has no data |
7382
| 13 | Export file missing or empty |
7483
| 14 | `--output` produced no file |
84+
| 15 | Hygiene: loose verts/edges, non-manifold, zero-area, doubles, or n-gons |
85+
| 16 | Grounded zmin (`--lift-z` lands here) |
86+
| 17 | Hay–twine BVH gap above 8 mm |

0 commit comments

Comments
 (0)