Skip to content

Commit fc9faa9

Browse files
TMHSDigitalclaude
andcommitted
fix(examples): redesign gn-instance-grid as a 3x3 macropad key field
The gallery review judged the hero programmer art: nine bare lime cubes on a 3x3 grid joined by thin lattice lines. The tree now instances a modeled DSA-profile keycap (six rounded-rectangle rings, a dished top, sharp foot ring) read in through Object Info, so the realized grid is the key field of a cobalt macropad: recessed well, switch housings, knurled brass knob and an OLED meter (render-only staging). A second Set Material, selected by a per-face position field, puts an orange accent on the front-right key. No floor labels. The check stays exactly as strict and gains a gate. Topology expectations are derived from the keycap's construction parameters (9 x 121 = 1089 verts, 1089 faces). The count gate now runs first (exit 4, where --one-cell still lands); the corner-cell gate (exit 5) asserts one whole keycap in the corner cell; the corner position gate (exit 7) checks bbox centre and the Transform lift; new exit 9 asserts the accent selection covers exactly one keycap at the front-right grid point. The render path adds the framing (10) and asset-quality (11) gates. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent f702110 commit fc9faa9

11 files changed

Lines changed: 992 additions & 243 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,15 +566,16 @@ and that a `Set Material` node carries the material through the remesh.
566566
</tr>
567567
<tr>
568568
<td width="46%" valign="middle">
569-
<a href="examples/gn-instance-grid/"><img src="examples/gn-instance-grid/preview.webp" alt="GN instance grid: nine lime-green cubes in a 3x3 grid on a dark studio floor, instanced via Geometry Nodes Instance on Points" /></a>
569+
<a href="examples/gn-instance-grid/"><img src="examples/gn-instance-grid/preview.webp" alt="GN instance grid: a cobalt-blue 3x3 macropad whose nine cream keycaps are instanced onto a Geometry Nodes Mesh Grid, one orange accent key picked out by a position-field Set Material" /></a>
570570
</td>
571571
<td valign="middle">
572572

573573
### [gn-instance-grid](examples/gn-instance-grid/)
574574

575-
A generative Geometry Nodes tree — Mesh Grid → Instance on Points → Realize Instances —
576-
attached as a `NODES` modifier with no Group Input. Asserts evaluated topology is
577-
verts = 72, faces = 54, and `Set Material` carries the lime accent.
575+
A generative Geometry Nodes tree — Mesh Grid → Instance on Points (a modeled keycap via
576+
`Object Info`) → Realize Instances — attached as a `NODES` modifier with no Group Input.
577+
Asserts evaluated topology is verts = faces = 1089 (9 keycaps × 121), and a position-field
578+
`Set Material` lands the orange accent on exactly one keycap.
578579

579580
</td>
580581
</tr>
55.2 KB
Loading
3.63 KB
Loading
-11.5 KB
Loading

‎docs/gallery/gn-instance-grid/index.html‎

Lines changed: 480 additions & 117 deletions
Large diffs are not rendered by default.

‎docs/gallery/index.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,12 +442,12 @@ <h2><a href="temp-override-join/">temp-override-join</a></h2>
442442
</article>
443443
<article class="card" data-tags="geometry-nodes instancing">
444444
<a class="card-media" href="gn-instance-grid/" tabindex="-1" aria-hidden="true">
445-
<img src="assets/gn-instance-grid-hero.webp" alt="A three-by-three grid of green instanced cubes, each sitting on a node of a faint source-grid lattice on a dark floor." loading="lazy" decoding="async" />
445+
<img src="assets/gn-instance-grid-hero.webp" alt="A cobalt-blue macropad with a brass knob and a glowing OLED meter, its three-by-three key field of cream keycaps instanced by Geometry Nodes, with one orange accent key at the front right." loading="lazy" decoding="async" />
446446
</a>
447447
<div class="card-body">
448448
<h2><a href="gn-instance-grid/">gn-instance-grid</a></h2>
449-
<p class="teaches">A generative Geometry Nodes tree — Mesh Grid → Instance on Points → Realize Instances → Set Shade Smooth — attached as a NODES modifier with no Group Input geometry.</p>
450-
<p class="witnesses"><span class="tag">witnesses</span> Realized instances produce closed-form topology (72 verts, 54 faces), Set Material carries Lime, and the corner instance center sits at its closed-form grid coordinate.</p>
449+
<p class="teaches">A generative Geometry Nodes tree — Mesh Grid → Instance on Points (a modeled keycap via Object Info) → Realize Instances → Set Shade Smooth → Set Material — attached as a NODES modifier with no Group Input geometry.</p>
450+
<p class="witnesses"><span class="tag">witnesses</span> Realized instances produce closed-form topology (9 keycaps × 121 = 1089 verts, 1089 faces), Set Material carries the keycap plastic, a position-field Set Material lands the accent on exactly one keycap, and the corner keycap sits at its closed-form grid coordinate.</p>
451451
<a class="card-link" href="gn-instance-grid/">View example<span class="sr-only"> gn-instance-grid</span> <span aria-hidden="true">&rarr;</span></a>
452452
</div>
453453
</article>

‎examples/gallery.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@
125125
{
126126
"name": "gn-instance-grid",
127127
"dir": "examples/gn-instance-grid",
128-
"teaches": "A generative Geometry Nodes tree — Mesh Grid → Instance on Points → Realize Instances → Set Shade Smooth — attached as a NODES modifier with no Group Input geometry.",
129-
"alt": "A three-by-three grid of green instanced cubes, each sitting on a node of a faint source-grid lattice on a dark floor.",
130-
"witnessesFix": "Realized instances produce closed-form topology (72 verts, 54 faces), Set Material carries Lime, and the corner instance center sits at its closed-form grid coordinate.",
128+
"teaches": "A generative Geometry Nodes tree — Mesh Grid → Instance on Points (a modeled keycap via Object Info) → Realize Instances → Set Shade Smooth → Set Material — attached as a NODES modifier with no Group Input geometry.",
129+
"alt": "A cobalt-blue macropad with a brass knob and a glowing OLED meter, its three-by-three key field of cream keycaps instanced by Geometry Nodes, with one orange accent key at the front right.",
130+
"witnessesFix": "Realized instances produce closed-form topology (9 keycaps × 121 = 1089 verts, 1089 faces), Set Material carries the keycap plastic, a position-field Set Material lands the accent on exactly one keycap, and the corner keycap sits at its closed-form grid coordinate.",
131131
"hero": "docs/gallery/assets/gn-instance-grid-hero.webp",
132132
"preview": "examples/gn-instance-grid/preview.webp",
133133
"tags": [

‎examples/gn-instance-grid/README.md‎

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
11
# GN Instance Grid
22

33
A runnable example that builds a generative Geometry Nodes tree — Mesh Grid →
4-
Instance on Points → Realize Instances → Transform → Set Shade Smooth — and
5-
attaches it as a `NODES` modifier, following the
4+
Instance on Points → Realize Instances → Transform → Set Shade Smooth → Set
5+
Material — and attaches it as a `NODES` modifier, following the
66
[`geometry-nodes-python`](../../skills/geometry-nodes-python/SKILL.md) skill. The
7-
tree has no Group Input: the grid and cube primitives live inside the node group.
7+
tree has no Group Input: the grid lives inside the node group, and the instance
8+
is a modeled DSA-profile keycap read in through an `Object Info` node (original
9+
transform space). The realized grid is the key field of a 3x3 macropad.
810

911
**What it witnesses:** instancing is not free geometry until you realize it. The
10-
check asserts the closed-form evaluated topology — verts = grid points × cube
11-
verts (3 × 3 × 8 = 72), faces = 9 × 6 — that a `Set Material` node carries the
12-
lime accent, and that the corner instance center sits at its closed-form grid
13-
coordinate. If Realize Instances is omitted, the evaluated mesh is empty and the
14-
counts fail.
12+
check asserts the closed-form evaluated topology — verts = grid points × keycap
13+
verts (9 × 121 = 1089), faces = 9 × 121 = 1089 — where the keycap counts come
14+
from its construction parameters (six rounded-rectangle rings of
15+
4 × (4 + 1) = 20 verts, plus the dish centre; five ring-to-ring quad bands, a
16+
20-triangle dish fan and one bottom n-gon), not from measuring the mesh. It
17+
also asserts that the (+x, +y) corner cell holds exactly one keycap, centred on
18+
its closed-form grid point with its foot at the Transform lift, that `Set
19+
Material` carries `Keycap.PBT`, and that a second `Set Material`, selected by a
20+
per-face position field, puts `Keycap.Accent` on exactly one keycap at the
21+
front-right grid point. If Realize Instances is bypassed, the evaluated mesh is
22+
empty and the count gate fails.
23+
24+
**What the render shows:** nine identical keycaps, one per grid point, seated on
25+
switch housings in the recessed well of an anodized case, and the one orange
26+
"enter" key the position-field selection picked out. The count gate is numeric:
27+
an unrealized grid renders the same keycaps, because the renderer draws
28+
instances either way. What does show is the grid itself — `--one-cell` renders
29+
a single keycap in the centre of an empty well — and where the accent
30+
selection landed. The knob, OLED, case and switch housings are render-only
31+
staging built in bmesh; only the key field comes from the tree.
1532

1633
## Run
1734

1835
```bash
1936
# Cheap correctness check (no render) — the CI check:
2037
blender --background --python gn_instance_grid.py --
2138

22-
# Falsifier: 1×1 grid. Must exit non-zero (corner instance missing).
39+
# Falsifier: 1×1 grid. Must exit non-zero (4: eight keycaps missing).
2340
blender --background --python gn_instance_grid.py -- --one-cell
2441

2542
# Also render a still (EEVEE on a GPU host; use --engine cycles on GPU-less hosts):
@@ -38,11 +55,14 @@ against it.
3855
| 1 | Uncaught exception (FATAL wrapper) |
3956
| 2 | argparse / usage |
4057
| 3 | Carrier vertex count ≠ 1 |
41-
| 4 | Corner instance vert count ≠ 8 (`--one-cell` lands here) |
42-
| 5 | Evaluated topology ≠ 72 verts / 54 faces |
43-
| 6 | Set Material did not carry Lime |
44-
| 7 | Corner instance center off the closed-form grid point |
58+
| 4 | Evaluated topology ≠ 1089 verts / 1089 faces (`--one-cell` lands here) |
59+
| 5 | Corner grid cell does not hold exactly one keycap (121 verts) |
60+
| 6 | Set Material did not carry `Keycap.PBT` and `Keycap.Accent` |
61+
| 7 | Corner keycap off its closed-form grid point or lift |
4562
| 8 | `--output` produced no file |
63+
| 9 | Accent selection did not cover exactly one keycap at the front-right point |
64+
| 10 | Render path: Layer 1 framing violation (`gallery_framing`) |
65+
| 11 | Render path: asset-quality floor violation (`gallery_asset_quality`) |
4666

4767
The `blender-smoke` workflow runs the check on Blender 5.2 LTS and 4.5 LTS
4868
(5.1 on the weekly cron, the `needs-5.1` PR label, or manual dispatch).

0 commit comments

Comments
 (0)