Skip to content

Commit 08e1acc

Browse files
TMHSDigitalclaude
andauthored
fix(examples): redesign mesh-hygiene-audit as a flanged street valve with marked defects (#269)
The gallery review judged the hero weak: a crude octagonal brass spool shown twice, the defects a thin orange wire that read as a render glitch, and floor labels unreadable at card size. The subject is now a designed upright street valve in eight named parts (body casting, side outlet, 22 flange bolts, gland nut, threaded stem, brass handwheel hub, rim and spokes; four materials, chamfered steps). The still shows a dirty copy beside the clean valve with no labels. The dirty body carries a hole, a flipped patch, an ngon and three loose verts. Markers are read back from audit incidence: red boundary tubes, red loose-vert beads and an amber ngon slot. Flipped faces and the inside of the hole glow red through the paint's Backfacing mix, so the renderer itself shows the winding. On the clean valve the same material shows no red. The check is stronger, not weaker. Gates 3-7 now run on every part, not just one mesh. A new winding-consistency gate (BMEdge.is_contiguous, exit 7) catches flipped patches that signed volume misses. --inject KIND covers every gate, including a buried second shell that only Euler (exit 8) can see. The render path adds the asset-quality floor (exit 11) and refuses to write a still if staging loses a defect class. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 415f4ed commit 08e1acc

11 files changed

Lines changed: 1069 additions & 799 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -992,19 +992,21 @@ with the Smooth-by-Angle modifier on 5.1.
992992
</tr>
993993
<tr>
994994
<td width="46%" valign="middle">
995-
<a href="examples/mesh-hygiene-audit/"><img src="examples/mesh-hygiene-audit/preview.webp" alt="Mesh hygiene audit: dual-panel dirty vs clean brass street valves filling the frame — left with backlit through-hole, emissive boundary tubes and loose-vert bead over a DIRTY placard, right intact CLEAN manifold — proving the engine-ingest topology checklist" /></a>
995+
<a href="examples/mesh-hygiene-audit/"><img src="examples/mesh-hygiene-audit/preview.webp" alt="Mesh hygiene audit: two blue flanged street valves with brass handwheels — the left dirty copy with a red-outlined hole, a red flipped patch on the bonnet, an amber ngon on the base flange and three red loose-vert beads, the right one intact — proving the engine-ingest topology checklist" /></a>
996996
</td>
997997
<td valign="middle">
998998

999999
### [mesh-hygiene-audit](examples/mesh-hygiene-audit/)
10001000

10011001
The mesh-cleanliness contract a prop pipeline relies on before engine ingest:
10021002
no ngons, no loose vertices, every edge bordering exactly two faces, no
1003-
zero-area faces, positive signed volume, and Euler `V − E + F == 2` for a
1004-
closed solid (measured 66/136/72, volume 0.652001). Companion to
1003+
zero-area faces, contiguous and outward winding on all eight parts of a
1004+
flanged street valve, and Euler `V − E + F == 2` on its body casting
1005+
(measured 802/1632/832, volume 0.453344). Companion to
10051006
[`collision-hull-proxy`](examples/collision-hull-proxy/) (hull watertightness)
1006-
and [`bmesh-gear`](examples/bmesh-gear/) (parametric closed solids). Dual-panel
1007-
still: DIRTY through-hole + loose-vert bead vs CLEAN manifold (same brass).
1007+
and [`bmesh-gear`](examples/bmesh-gear/) (parametric closed solids). Still: a
1008+
dirty copy with a hole, flipped patch, ngon and loose verts marked from live
1009+
audit data beside the intact valve; the paint glows red on any back face.
10081010

10091011
</td>
10101012
</tr>
55.9 KB
Loading
18.3 KB
Loading
7.68 KB
Loading

‎docs/gallery/index.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,12 +739,12 @@ <h2><a href="gp-lineart-contour/">gp-lineart-contour</a></h2>
739739
</article>
740740
<article class="card" data-tags="bmesh mesh game-pipeline">
741741
<a class="card-media" href="mesh-hygiene-audit/" tabindex="-1" aria-hidden="true">
742-
<img src="assets/mesh-hygiene-audit-hero.webp" alt="Two brass spool-shaped props labelled DIRTY and CLEAN; the dirty one has glowing orange stray edges inside it." loading="lazy" decoding="async" />
742+
<img src="assets/mesh-hygiene-audit-hero.webp" alt="Two blue street valves with brass handwheels: the left has a red-outlined hole, a red bonnet patch, an amber flange patch and three red beads beside it; the right is intact." loading="lazy" decoding="async" />
743743
</a>
744744
<div class="card-body">
745745
<h2><a href="mesh-hygiene-audit/">mesh-hygiene-audit</a></h2>
746-
<p class="teaches">Engine-ingest mesh hygiene on an octagonal street valve: no ngons, no loose verts, manifold edges, no zero-area faces, positive signed volume, Euler V-E+F==2. Dual-panel still shows a through-hole and loose-vert bead derived from live mesh incidence — same brass on both so color alone cannot carry the proof.</p>
747-
<p class="witnesses"><span class="tag">witnesses</span> Pipelines that skip topology gates ship open boundaries, loose verts, or non-sphere Euler into engine ingest. The still makes the boundary hole and loose vert readable; ngon / zero-area / full winding invert remain check-only.</p>
746+
<p class="teaches">Engine-ingest mesh hygiene on every part of a flanged street valve: no ngons, no loose verts, manifold edges, no zero-area faces, contiguous and outward winding, Euler V-E+F==2 on the body casting. A dirty copy carries a hole, a flipped patch, an ngon and loose verts, each marked from live audit incidence; the paint glows red wherever the renderer sees a back face.</p>
747+
<p class="witnesses"><span class="tag">witnesses</span> Pipelines that skip topology gates ship open boundaries, flipped patches, ngons, loose verts or stray shells into engine ingest. The still shows the first four on a dirty copy; zero-area faces and a buried second shell remain check-only.</p>
748748
<a class="card-link" href="mesh-hygiene-audit/">View example<span class="sr-only"> mesh-hygiene-audit</span> <span aria-hidden="true">&rarr;</span></a>
749749
</div>
750750
</article>

‎docs/gallery/mesh-hygiene-audit/index.html‎

Lines changed: 513 additions & 390 deletions
Large diffs are not rendered by default.

‎examples/gallery.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,9 @@
487487
{
488488
"name": "mesh-hygiene-audit",
489489
"dir": "examples/mesh-hygiene-audit",
490-
"teaches": "Engine-ingest mesh hygiene on an octagonal street valve: no ngons, no loose verts, manifold edges, no zero-area faces, positive signed volume, Euler V-E+F==2. Dual-panel still shows a through-hole and loose-vert bead derived from live mesh incidence — same brass on both so color alone cannot carry the proof.",
491-
"alt": "Two brass spool-shaped props labelled DIRTY and CLEAN; the dirty one has glowing orange stray edges inside it.",
492-
"witnessesFix": "Pipelines that skip topology gates ship open boundaries, loose verts, or non-sphere Euler into engine ingest. The still makes the boundary hole and loose vert readable; ngon / zero-area / full winding invert remain check-only.",
490+
"teaches": "Engine-ingest mesh hygiene on every part of a flanged street valve: no ngons, no loose verts, manifold edges, no zero-area faces, contiguous and outward winding, Euler V-E+F==2 on the body casting. A dirty copy carries a hole, a flipped patch, an ngon and loose verts, each marked from live audit incidence; the paint glows red wherever the renderer sees a back face.",
491+
"alt": "Two blue street valves with brass handwheels: the left has a red-outlined hole, a red bonnet patch, an amber flange patch and three red beads beside it; the right is intact.",
492+
"witnessesFix": "Pipelines that skip topology gates ship open boundaries, flipped patches, ngons, loose verts or stray shells into engine ingest. The still shows the first four on a dirty copy; zero-area faces and a buried second shell remain check-only.",
493493
"hero": "docs/gallery/assets/mesh-hygiene-audit-hero.webp",
494494
"preview": "examples/mesh-hygiene-audit/preview.webp",
495495
"tags": [
Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Mesh Hygiene Audit
22

3-
A runnable example that builds an octagonal street valve body and runs the
4-
**engine-ingest mesh hygiene checklist** as executable topology checks,
5-
following [`mesh-editing-and-bmesh`](../../skills/mesh-editing-and-bmesh/SKILL.md).
3+
A runnable example that builds an upright flanged street valve — body
4+
casting, side outlet, 22 flange bolts, gland nut, threaded stem, brass
5+
handwheel hub, rim and spokes — and runs the **engine-ingest mesh hygiene
6+
checklist** on every part as executable topology checks, following
7+
[`mesh-editing-and-bmesh`](../../skills/mesh-editing-and-bmesh/SKILL.md).
68

79
**Pipeline arc neighbors:** watertight / Euler on collision *hulls* in
810
[`collision-hull-proxy`](../collision-hull-proxy/), parametric closed solids
@@ -12,67 +14,87 @@ in [`bmesh-gear`](../bmesh-gear/), LOD face budgets in
1214
pipeline runs on the *render* mesh before hull / LOD / export.
1315

1416
**Scope:** this witnesses the bpy-level contract a prop pipeline relies on
15-
(tris+quads, no loose verts, manifold edges, no zero-area faces, outward
16-
winding, Euler 2 for a closed solid). It is not an engine exporter.
17+
(tris+quads, no loose verts, manifold edges, no zero-area faces, consistent
18+
and outward winding, Euler 2 for the genus-0 body casting). It is not an
19+
engine exporter.
1720

1821
**What it witnesses:** every gate is derived from mesh combinatorics or the
19-
divergence-theorem volume — never from a prior-run capture:
22+
divergence-theorem volume — never from a prior-run capture. Gates 3–7 run on
23+
all eight parts; the Euler gate runs on the body casting, the one closed
24+
genus-0 shell the other parts mount on (the handwheel rim is a torus, the
25+
bolt and spoke meshes are many shells, so a single-sphere Euler test does
26+
not describe them):
2027

2128
- **No ngons.** `len(poly.vertices) <= 4` for every face.
2229
- **No loose vertices.** Every vert has degree ≥ 1.
2330
- **Manifold edges.** Every edge borders exactly 2 faces (closed solid).
2431
- **No zero-area faces.** Face area > 1e-10; prints measured `min_area`.
32+
- **Consistent winding.** Every manifold edge is `BMEdge.is_contiguous` —
33+
a flipped patch leaves seam edges whose two faces traverse it the same way.
2534
- **Outward winding.** Positive signed volume (divergence theorem).
26-
- **Euler sphere.** `V − E + F == 2` for the clean closed manifold
27-
(measured: verts=66 edges=136 faces=72, volume≈0.652001, min_area≈1.146e-02).
35+
- **Euler sphere.** `V − E + F == 2` on the body casting
36+
(measured: verts=802 edges=1632 faces=832, volume≈0.453344,
37+
min_area≈1.223e-03).
2838

29-
**What each check catches on failure:** loose vert injected (exit 4);
30-
face deleted → boundary edges (exit 5); edge dissolved → ngon (exit 3);
31-
all faces flipped → signed volume negated (exit 7); face collapsed →
32-
zero-area (exit 6).
39+
**What each check catches on failure** (`--inject KIND`, default target the
40+
body casting, `--inject-part NAME` for any other part): `ngon` → exit 3;
41+
`loose` → exit 4; `boundary` (one face deleted) → exit 5; `zero_area` (face
42+
collapsed) → exit 6; `flip_patch` (one face flipped) → exit 7 on winding
43+
seams; `flip` (all faces) → exit 7 on negative volume; `shell` (a leftover
44+
second closed shell buried inside) → exit 8, the one defect every per-edge
45+
gate misses. `--inject-ngon` is kept as an alias for `--inject ngon`.
3346

34-
**Version witness:** output is byte-identical on Blender 4.5.11 LTS and
35-
5.1.2 — same counts, same volume, same `min_area`.
47+
**Version witness:** the check output is identical on Blender 5.2.1 LTS,
48+
5.1.2 and 4.5.11 LTS — same counts, same volume, same `min_area`.
3649

37-
**Render as proof:** dual panel, same brass on both. DIRTY stages a
38-
camera-facing through-hole (boundary edges) plus a loose vert; emissive
39-
beads/edge tubes are built from the live mesh incidence the check uses —
40-
not decorative paint. CLEAN is the intact manifold. An out-of-frame AREA
41-
light rakes through the hole from behind so the aperture reads warm without
42-
a visible light panel in frame.
50+
**Render as proof:** a dirty copy of the same valve (left) beside the clean
51+
valve (right), same paint on both. The dirty body casting carries four real
52+
gate failures, each placed on the camera-facing side: a hole through the
53+
globe (open boundary), a flipped patch on the bonnet dome, an ngon merged
54+
into the base-flange annulus, and three stray loose vertices. The markers are
55+
read back from the dirty mesh's audit incidence, not from the staging code:
56+
boundary edges become glowing red tubes, loose verts red beads, ngon faces an
57+
amber material slot. The flipped patch and the inside of the hole need no
58+
marker — the paint mixes to red on the shader's own `Backfacing` output, so
59+
the renderer shows every face it sees from behind. On the clean valve that
60+
same material shows no red anywhere, because no back side is visible on a
61+
closed, outward-wound shell. The render path refuses to write a still
62+
(exit 9) if staging loses any of the four defect classes.
4363

44-
**Not depicted in the still (check-proven only):** ngon dissolve, zero-area
45-
collapse, and full-mesh winding invert — they do not read as geometry at
46-
thumbnail scale without faking annotation.
64+
**Not depicted in the still (check-proven only):** zero-area collapse and
65+
the buried second shell — neither changes a single pixel.
4766

4867
## Run
4968

5069
```bash
5170
blender --background --python mesh_hygiene_audit.py --
52-
blender --background --python mesh_hygiene_audit.py -- --inject-ngon
71+
blender --background --python mesh_hygiene_audit.py -- --inject ngon
72+
blender --background --python mesh_hygiene_audit.py -- --inject flip_patch --inject-part Valve.HandwheelRim
5373
blender --background --python mesh_hygiene_audit.py -- --output hygiene.png
5474
blender --background --python mesh_hygiene_audit.py -- --output hygiene.png --engine cycles
5575
```
5676

5777
## Exit codes
5878

5979
Per-script sequential checks. `9` is a valid check code; there is no rule
60-
against it. `10` is the shared framing helper.
80+
against it. `10` is the shared framing helper, `11` the shared asset-quality
81+
helper.
6182

6283
| Code | Meaning |
6384
| --- | --- |
6485
| 0 | Success |
6586
| 1 | Uncaught exception (FATAL wrapper) |
6687
| 2 | argparse / usage |
67-
| 3 | Ngon present (`--inject-ngon` lands here) |
88+
| 3 | Ngon present (`--inject ngon` lands here) |
6889
| 4 | Loose vertices |
6990
| 5 | Non-manifold or boundary edges |
7091
| 6 | Zero-area faces |
71-
| 7 | Signed volume ≤ 0 |
72-
| 8 | Euler characteristic ≠ 2 |
73-
| 9 | `--output` produced no file |
92+
| 7 | Winding seam edges, or signed volume ≤ 0 |
93+
| 8 | Body casting Euler characteristic ≠ 2 |
94+
| 9 | `--output` produced no file, or dirty staging lost a defect class |
7495
| 10 | Gallery framing violation |
96+
| 11 | Gallery asset-quality floor violation |
7597

7698
The `blender-smoke` workflow runs the check on Blender 5.2 LTS and 4.5 LTS
7799
(5.1 on the weekly cron, the `needs-5.1` PR label, or manual dispatch).
78-
Smoke does not pass `--output` or `--inject-ngon`.
100+
Smoke does not pass `--output` or `--inject`.

0 commit comments

Comments
 (0)