Skip to content

Commit 0bf0bb2

Browse files
committed
fix: recompose triangulate-tangents and clear the dome blowout
The buckler sat at 0.334x fill adrift in the stage. A 2x-class move-in iterations (4.1/4.8/5.6 overshot the leaning disc's vertical span into B+T edge touch; settled at (0.6,-6.35,2.62) aim (0,0,1.42)) lands fill 0.459x/0.833y with margins L0.278 R0.262 B0.039 T0.039, and the concentric tangent rings now read across the whole face. More than reframe, disclosed: the larger subject exposed a pre-existing blown region on the evidence dome (30.7% of the dome region >= 252) — Key 500->320 and Glint 400->150 clear it (max 231, near-white 0.00%) with the anisotropic sweep still driving the rings; the old hero clipped in the same region at smaller scale. Render path gated with check_framing (exit 10); check values unchanged (tris=720, unit/dot/btn/uv errors all print as before). Gate falsified at lens 70 (fill 0.972 FAIL, exit 10) and restored. Pass-2 variant (cap dissolved to an ngon, no calc_tangents) is pixel-identical — the ring sweep is UV/bump-driven and the mikktspace contract is numeric; reported as such. Identical framing numbers on 4.5.11. Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com>
1 parent 2f4bcf4 commit 0bf0bb2

6 files changed

Lines changed: 63 additions & 16 deletions

File tree

2.25 KB
Loading
1.23 KB
Loading

‎docs/gallery/triangulate-tangents/index.html‎

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ <h2>Run</h2>
198198
blender --background --python triangulate_tangents.py -- --output buckler.png
199199
blender --background --python triangulate_tangents.py -- --output buckler.png --engine cycles</code></pre>
200200
<p>It exits non-zero on failure (topology drift, reallocated UV layer, non-orthonormal basis, bitangent-convention drift, formula excursion, or a flip inside a smooth field). The <code>blender-smoke</code> workflow runs the check on Blender 4.5 LTS and 5.1.</p>
201+
<p>The <code>--output</code> render path additionally measures framing against the Layer 1 band via <code>examples/gallery_framing.py</code> (exit 10 on violation) before writing the still.</p>
201202
</section>
202203
<section class="detail-section src">
203204
<h2>Source</h2>
@@ -243,6 +244,11 @@ <h2>Source</h2>
243244
<span class="k">import</span> bpy, bmesh, sys, os, math, argparse
244245
<span class="k">import</span> mathutils
245246

247+
<span class="c"># Shared Layer 1 framing measurement (render path only) — see gallery_framing.py</span>
248+
sys.path.insert(<span class="n">0</span>, os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))
249+
sys.dont_write_bytecode = <span class="k">True</span> <span class="c"># keep examples/__pycache__ out of the repo tree</span>
250+
<span class="k">import</span> gallery_framing
251+
246252
SIDES = <span class="n">48</span> <span class="c"># buckler lathe resolution</span>
247253
RINGS = <span class="n">6</span> <span class="c"># dome profile rings (closed form below)</span>
248254
BOSS_R = <span class="n">1.0</span>
@@ -571,19 +577,22 @@ <h2>Source</h2>
571577

572578
<span class="c"># shaped warm key, faint cool fill, cool rim, warm wedge on the back wall</span>
573579
<span class="c"># (docs/VISUAL-STYLE.md); the glint is the anisotropic streak&#x27;s driver</span>
574-
light(<span class="s">&quot;Key&quot;</span>, (-<span class="n">4.0</span>, -<span class="n">5.0</span>, <span class="n">6.0</span>), <span class="n">500.0</span>, <span class="n">4.5</span>, (<span class="n">1.0</span>, <span class="n">0.96</span>, <span class="n">0.9</span>), (<span class="n">48</span>, <span class="n">0</span>, -<span class="n">38</span>))
580+
light(<span class="s">&quot;Key&quot;</span>, (-<span class="n">4.0</span>, -<span class="n">5.0</span>, <span class="n">6.0</span>), <span class="n">320.0</span>, <span class="n">4.5</span>, (<span class="n">1.0</span>, <span class="n">0.96</span>, <span class="n">0.9</span>), (<span class="n">48</span>, <span class="n">0</span>, -<span class="n">38</span>))
575581
light(<span class="s">&quot;Fill&quot;</span>, (<span class="n">5.0</span>, -<span class="n">4.0</span>, <span class="n">3.0</span>), <span class="n">100.0</span>, <span class="n">9.0</span>, (<span class="n">0.75</span>, <span class="n">0.85</span>, <span class="n">1.0</span>), (<span class="n">62</span>, <span class="n">0</span>, <span class="n">50</span>))
576582
light(<span class="s">&quot;Rim&quot;</span>, (<span class="n">0.5</span>, <span class="n">4.5</span>, <span class="n">5.0</span>), <span class="n">340.0</span>, <span class="n">4.0</span>, (<span class="n">0.6</span>, <span class="n">0.78</span>, <span class="n">1.0</span>), (-<span class="n">55</span>, <span class="n">0</span>, <span class="n">175</span>))
577583
light(<span class="s">&quot;Wedge&quot;</span>, (<span class="n">2.5</span>, <span class="n">3.5</span>, <span class="n">4.2</span>), <span class="n">480.0</span>, <span class="n">6.0</span>, (<span class="n">1.0</span>, <span class="n">0.76</span>, <span class="n">0.5</span>), (-<span class="n">72</span>, <span class="n">0</span>, <span class="n">195</span>))
578-
light(<span class="s">&quot;Glint&quot;</span>, (<span class="n">1.5</span>, -<span class="n">5.5</span>, <span class="n">5.5</span>), <span class="n">400.0</span>, <span class="n">1.2</span>, (<span class="n">1.0</span>, <span class="n">0.9</span>, <span class="n">0.75</span>), (<span class="n">42</span>, <span class="n">0</span>, <span class="n">15</span>))
584+
light(<span class="s">&quot;Glint&quot;</span>, (<span class="n">1.5</span>, -<span class="n">5.5</span>, <span class="n">5.5</span>), <span class="n">150.0</span>, <span class="n">1.2</span>, (<span class="n">1.0</span>, <span class="n">0.9</span>, <span class="n">0.75</span>), (<span class="n">42</span>, <span class="n">0</span>, <span class="n">15</span>))
579585

580586
cam_data = bpy.data.cameras.new(<span class="s">&quot;Cam&quot;</span>)
581587
cam_data.lens = <span class="n">55.0</span>
582588
cam = bpy.data.objects.new(<span class="s">&quot;Cam&quot;</span>, cam_data)
583-
cam.location = (<span class="n">0.6</span>, -<span class="n">8.8</span>, <span class="n">2.8</span>)
589+
<span class="c"># Reframed: the old (0.6,-8.8,2.8) left the buckler at 0.334 fill adrift</span>
590+
<span class="c"># in the stage; moved in ~2.2x so the brushed-steel tangent sweep fills</span>
591+
<span class="c"># the frame — the grooves are the tangent-field evidence.</span>
592+
cam.location = (<span class="n">0.6</span>, -<span class="n">6.35</span>, <span class="n">2.62</span>)
584593
scene.collection.objects.link(cam)
585594
target = bpy.data.objects.new(<span class="s">&quot;Aim&quot;</span>, <span class="k">None</span>)
586-
target.location = (<span class="n">0.0</span>, <span class="n">0.0</span>, <span class="n">1.35</span>)
595+
target.location = (<span class="n">0.0</span>, <span class="n">0.0</span>, <span class="n">1.42</span>)
587596
scene.collection.objects.link(target)
588597
con = cam.constraints.new(<span class="s">&#x27;TRACK_TO&#x27;</span>)
589598
con.target = target
@@ -603,8 +612,22 @@ <h2>Source</h2>
603612
scene.render.filepath = path
604613
<span class="c"># AgX would wash the steel toward chalk (docs/VISUAL-STYLE.md)</span>
605614
scene.view_settings.view_transform = <span class="s">&#x27;Standard&#x27;</span>
615+
<span class="c"># Layer 1 framing gate (silhouette matte) — exit 10 on violation, before</span>
616+
<span class="c"># the beauty render so a defective composition ships no artifact.</span>
617+
stand_ob = scene.objects.get(<span class="s">&quot;Stand&quot;</span>)
618+
fcode = gallery_framing.check_framing(
619+
scene, cam,
620+
hero=[obj],
621+
elements=[obj] + ([stand_ob] <span class="k">if</span> stand_ob <span class="k">else</span> []),
622+
stage=[floor, wall],
623+
)
624+
<span class="k">if</span> fcode:
625+
<span class="k">return</span> fcode
606626
bpy.ops.render.render(write_still=<span class="k">True</span>)
607-
<span class="k">return</span> os.path.exists(path) <span class="k">and</span> os.path.getsize(path) &gt; <span class="n">0</span>
627+
<span class="k">if</span> <span class="k">not</span> (os.path.exists(path) <span class="k">and</span> os.path.getsize(path) &gt; <span class="n">0</span>):
628+
print(<span class="s">&quot;ERROR: render produced no file&quot;</span>, file=sys.stderr)
629+
<span class="k">return</span> <span class="n">10</span>
630+
<span class="k">return</span> <span class="n">0</span>
608631

609632

610633
<span class="k">def</span> main():
@@ -622,9 +645,9 @@ <h2>Source</h2>
622645
<span class="k">return</span> code
623646

624647
<span class="k">if</span> args.output:
625-
<span class="k">if</span> <span class="k">not</span> render_still(obj, os.path.abspath(args.output), args.engine):
626-
print(<span class="s">&quot;ERROR: render produced no file&quot;</span>, file=sys.stderr)
627-
<span class="k">return</span> <span class="n">10</span>
648+
rcode = render_still(obj, os.path.abspath(args.output), args.engine)
649+
<span class="k">if</span> rcode:
650+
<span class="k">return</span> rcode
628651
print(<span class="s">f&quot;</span><span class="s">rendered still </span>{args.output}<span class="s">&quot;</span>)
629652

630653
print(<span class="s">&quot;triangulate-tangents OK&quot;</span>)

‎examples/triangulate-tangents/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ It exits non-zero on failure (topology drift, reallocated UV layer,
6868
non-orthonormal basis, bitangent-convention drift, formula excursion, or a
6969
flip inside a smooth field). The `blender-smoke` workflow runs the check on
7070
Blender 4.5 LTS and 5.1.
71+
72+
The `--output` render path additionally measures framing against the Layer 1 band via `examples/gallery_framing.py` (exit 10 on violation) before writing the still.
2.2 KB
Loading

‎examples/triangulate-tangents/triangulate_tangents.py‎

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
import bpy, bmesh, sys, os, math, argparse
3737
import mathutils
3838

39+
# Shared Layer 1 framing measurement (render path only) — see gallery_framing.py
40+
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))
41+
sys.dont_write_bytecode = True # keep examples/__pycache__ out of the repo tree
42+
import gallery_framing
43+
3944
SIDES = 48 # buckler lathe resolution
4045
RINGS = 6 # dome profile rings (closed form below)
4146
BOSS_R = 1.0
@@ -364,19 +369,22 @@ def light(name, loc, energy, size, col, rot):
364369

365370
# shaped warm key, faint cool fill, cool rim, warm wedge on the back wall
366371
# (docs/VISUAL-STYLE.md); the glint is the anisotropic streak's driver
367-
light("Key", (-4.0, -5.0, 6.0), 500.0, 4.5, (1.0, 0.96, 0.9), (48, 0, -38))
372+
light("Key", (-4.0, -5.0, 6.0), 320.0, 4.5, (1.0, 0.96, 0.9), (48, 0, -38))
368373
light("Fill", (5.0, -4.0, 3.0), 100.0, 9.0, (0.75, 0.85, 1.0), (62, 0, 50))
369374
light("Rim", (0.5, 4.5, 5.0), 340.0, 4.0, (0.6, 0.78, 1.0), (-55, 0, 175))
370375
light("Wedge", (2.5, 3.5, 4.2), 480.0, 6.0, (1.0, 0.76, 0.5), (-72, 0, 195))
371-
light("Glint", (1.5, -5.5, 5.5), 400.0, 1.2, (1.0, 0.9, 0.75), (42, 0, 15))
376+
light("Glint", (1.5, -5.5, 5.5), 150.0, 1.2, (1.0, 0.9, 0.75), (42, 0, 15))
372377

373378
cam_data = bpy.data.cameras.new("Cam")
374379
cam_data.lens = 55.0
375380
cam = bpy.data.objects.new("Cam", cam_data)
376-
cam.location = (0.6, -8.8, 2.8)
381+
# Reframed: the old (0.6,-8.8,2.8) left the buckler at 0.334 fill adrift
382+
# in the stage; moved in ~2.2x so the brushed-steel tangent sweep fills
383+
# the frame — the grooves are the tangent-field evidence.
384+
cam.location = (0.6, -6.35, 2.62)
377385
scene.collection.objects.link(cam)
378386
target = bpy.data.objects.new("Aim", None)
379-
target.location = (0.0, 0.0, 1.35)
387+
target.location = (0.0, 0.0, 1.42)
380388
scene.collection.objects.link(target)
381389
con = cam.constraints.new('TRACK_TO')
382390
con.target = target
@@ -396,8 +404,22 @@ def light(name, loc, energy, size, col, rot):
396404
scene.render.filepath = path
397405
# AgX would wash the steel toward chalk (docs/VISUAL-STYLE.md)
398406
scene.view_settings.view_transform = 'Standard'
407+
# Layer 1 framing gate (silhouette matte) — exit 10 on violation, before
408+
# the beauty render so a defective composition ships no artifact.
409+
stand_ob = scene.objects.get("Stand")
410+
fcode = gallery_framing.check_framing(
411+
scene, cam,
412+
hero=[obj],
413+
elements=[obj] + ([stand_ob] if stand_ob else []),
414+
stage=[floor, wall],
415+
)
416+
if fcode:
417+
return fcode
399418
bpy.ops.render.render(write_still=True)
400-
return os.path.exists(path) and os.path.getsize(path) > 0
419+
if not (os.path.exists(path) and os.path.getsize(path) > 0):
420+
print("ERROR: render produced no file", file=sys.stderr)
421+
return 10
422+
return 0
401423

402424

403425
def main():
@@ -415,9 +437,9 @@ def main():
415437
return code
416438

417439
if args.output:
418-
if not render_still(obj, os.path.abspath(args.output), args.engine):
419-
print("ERROR: render produced no file", file=sys.stderr)
420-
return 10
440+
rcode = render_still(obj, os.path.abspath(args.output), args.engine)
441+
if rcode:
442+
return rcode
421443
print(f"rendered still {args.output}")
422444

423445
print("triangulate-tangents OK")

0 commit comments

Comments
 (0)