Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
3736 lines (3569 loc) · 196 KB
/
Copy pathindex.html
File metadata and controls
3736 lines (3569 loc) · 196 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Bookshelf (bookshelf) — Showcase — Blender Developer Tools</title>
<meta name="description" content="A procedural bookcase — two housed shelves, a base on a recessed plinth, lapped back boards and a stepped cornice, filled with thirty-eight rounded-spine hardbacks standing, stacked and leaning — carried through UVs, bake, LOD, convex collider, and Unity glTF, asserting recomputed budgets rather than an API contract." />
<link rel="canonical" href="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/bookshelf/" />
<meta property="og:url" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/bookshelf/" />
<link rel="icon" href="../../assets/favicon.svg" type="image/svg+xml" />
<meta name="theme-color" content="#1a1b1e" />
<meta name="color-scheme" content="dark" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Bookshelf (bookshelf) — Showcase — Blender Developer Tools" />
<meta property="og:description" content="A procedural bookcase — two housed shelves, a base on a recessed plinth, lapped back boards and a stepped cornice, filled with thirty-eight rounded-spine hardbacks standing, stacked and leaning — carried through UVs, bake, LOD, convex collider, and Unity glTF, asserting recomputed budgets rather than an API contract." />
<meta property="og:image" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/assets/bookshelf-hero.webp" />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="720" />
<meta property="og:image:alt" content="A stained wooden bookcase with three shelves of cloth and leather hardbacks with gilt spine bands, some standing, some stacked flat, and two leaning against their neighbours." />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/assets/bookshelf-hero.webp" />
<meta name="twitter:image:alt" content="A stained wooden bookcase with three shelves of cloth and leather hardbacks with gilt spine bands, some standing, some stacked flat, and two leaning against their neighbours." />
<meta property="og:site_name" content="Blender Developer Tools" />
<meta name="twitter:title" content="Bookshelf (bookshelf) — Showcase — Blender Developer Tools" />
<meta name="twitter:description" content="A procedural bookcase — two housed shelves, a base on a recessed plinth, lapped back boards and a stepped cornice, filled with thirty-eight rounded-spine hardbacks standing, stacked and leaning — carried through UVs, bake, LOD, convex collider, and Unity glTF, asserting recomputed budgets rather than an API contract." />
<link rel="preload" href="../../fonts/inter-regular.woff2" as="font" type="font/woff2" crossorigin />
<link rel="stylesheet" href="../gallery.css?v=27ce4298f2" />
<script>document.documentElement.classList.add('js');</script>
</head>
<body>
<a class="skip" href="#main">Skip to content</a>
<header class="site-header">
<div class="site-header-inner">
<a class="site-brand" href="../../"><span class="site-brand-dot" aria-hidden="true"></span>Blender Developer Tools</a>
<button class="site-menu-btn" type="button" aria-expanded="false" aria-controls="site-nav"><span class="site-menu-icon" aria-hidden="true"></span>Menu</button>
<nav class="site-nav" id="site-nav" aria-label="Primary">
<ul><li><a href="../../gallery/#k=examples">Examples</a></li><li><a href="../../gallery/#k=showcase">Showcase</a></li><li><a href="../../#new">What's new</a></li><li><a href="../../#skills">Skills</a></li><li><a href="../../#rules">Rules</a></li><li><a href="../../#snippets">Snippets</a></li><li><a href="../../#install">Install</a></li><li class="gh"><a href="https://github.com/TMHSDigital/Blender-Developer-Tools">GitHub</a></li></ul>
</nav>
</div>
</header>
<header class="hero">
<nav class="crumbs" aria-label="Breadcrumb"><ol><li><a href="../" id="crumbGallery">Gallery</a></li><li><a href="../#k=showcase">Showcase</a></li><li aria-current="page">bookshelf</li></ol></nav>
<h1>Bookshelf</h1>
<p class="slug">showcase/bookshelf/</p>
<p>A procedural bookcase — two housed shelves, a base on a recessed plinth, lapped back boards and a stepped cornice, filled with thirty-eight rounded-spine hardbacks standing, stacked and leaning — carried through UVs, bake, LOD, convex collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
</header>
<main id="main">
<nav class="pager" aria-label="Showcase pieces"><a rel="prev" href="../butter-churn/" aria-label="Previous showcase piece: butter-churn"><span aria-hidden="true">←</span> butter-churn</a><span class="pager-pos hud">35 of 76 showcase pieces<span class="pager-keys"> · <kbd>←</kbd><kbd>→</kbd></span></span><a rel="next" href="../book-trolley/" aria-label="Next showcase piece: book-trolley">book-trolley <span aria-hidden="true">→</span></a></nav>
<button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: A stained wooden bookcase with three shelves of cloth and leather hardbacks with gilt spine bands, some standing, some stacked flat, and two leaning against their neighbours.">
<img src="../assets/bookshelf-hero.webp" alt="A stained wooden bookcase with three shelves of cloth and leather hardbacks with gilt spine bands, some standing, some stacked flat, and two leaning against their neighbours." width="1280" height="720" fetchpriority="high" />
</button>
<p class="zoom-hint">Rendered headless by the showcase piece itself. Select it to enlarge.</p>
<div class="callout"><span class="tag">witnesses</span> Recomputed: 10908 tris, five materials with 338 wood, 2050 cloth, 1066 leather, 228 paper and 1976 gilt faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.972×0.332×1.176 m, zmin 0, hygiene 0 including zero coplanar cross-shell pairs, both sides on the floor, four cross members 8 mm into both sides, 38 books each with one page block 0.6 mm into its boards and two gilt bands 0.3 mm into the spine and 0.8 mm proud, every book seated 1.0–3.2 mm, 44 mm headroom, thickness and height spread 2.90 and 1.65, both leaning books 0.8 mm onto their neighbour's head edge, zero unplanned book overlaps, zero right-angle wood edges, convex collider 68 tris. --air-lean and --deep-lean exit 22 on the lean contact while every seat, the envelope and the overlap budget still pass; --crowd-books exits 23; --uniform-books 21; --tall-book 20.</div>
<p class="taglist"><span class="tag">category</span> <a href="../#k=showcase&c=village">Village</a></p>
<p class="taglist"><span class="tag">tags</span> <a href="../#tag=mesh">mesh</a> <a href="../#tag=export">export</a> <a href="../#tag=showcase">showcase</a></p>
<div class="runline">
<pre id="runCmd">blender --background --python showcase/bookshelf/bookshelf.py --</pre>
<button class="copy-btn" id="copyRun" type="button">Copy</button>
</div>
<section class="detail-section md">
<p>A bookcase: a stained carcass with two shelves housed in its sides, a base on a recessed plinth, lapped back boards and a stepped cornice, filled with thirty-eight hardbacks. Twenty-nine stand upright, seven lie in three stacks, and two lean on a neighbour. Every book is a rounded-spine cover in cloth or leather, a page block glued into it, and two gilt bands tooled round the spine. <strong>A showcase piece, not an example</strong> — it witnesses no API contract. It asserts that generated geometry meets declared asset budgets, recomputed from the finished mesh.</p>
<h2 id="what-it-composes">What it composes<a class="anchor" href="#what-it-composes" aria-label="Link to this section">#</a></h2>
<div class="table-wrap"><table><thead><tr><th scope="col">Shipped content</th><th scope="col">Used for</th></tr></thead><tbody><tr><td><code>skills/mesh-editing-and-bmesh</code></td><td>chamfered boards, U-section covers with rounded spines, page blocks and bands built on the spine's own chain, all in <code>bmesh</code></td></tr><tr><td><code>skills/custom-properties</code></td><td>face attributes (<code>PlankTone</code>, <code>GrainDir</code>, <code>Tint</code>) read by the shaders</td></tr><tr><td><code>skills/procedural-materials-and-shaders</code></td><td>grained stain, cloth, leather, ruled page edges, gilt</td></tr><tr><td><code>skills/bake-high-to-low</code></td><td>Cycles tangent-space normal bake, high onto low</td></tr><tr><td><code>skills/engine-export-presets</code></td><td>Unity glTF (<code>export_yup=True</code>)</td></tr><tr><td><code>skills/depsgraph-and-evaluated-data</code></td><td>evaluated triangle counts for the LOD ratios</td></tr><tr><td><code>snippets/decimate_to_budget.py</code></td><td>LOD1 / LOD2 COLLAPSE chain</td></tr><tr><td><code>snippets/convex_hull_collider.py</code></td><td>one hull over the carcass</td></tr><tr><td><code>snippets/lod_chain.py</code></td><td>LOD naming and ratio pattern</td></tr><tr><td><code>examples/mesh-hygiene-audit</code></td><td>hygiene combinatorics (copied, not imported)</td></tr></tbody></table></div>
<h2 id="the-budget-that-matters">The budget that matters<a class="anchor" href="#the-budget-that-matters" aria-label="Link to this section">#</a></h2>
<p>A leaning book has to rest on its neighbour's head edge and on the shelf, not in either. Tip it a few degrees too far and its board cuts through the neighbour's corner; not far enough and it stands in the air against nothing. Neither is visible to any other budget:</p>
<ul><li>the leaning book still stands on its shelf, so the seat budget passes;</li><li>it stays inside the carcass, so the bounding box does not move;</li><li>the triangle count is the same, because only a position changed;</li><li>the book-overlap budget has to exempt this very contact, so it cannot see how deep the contact goes.</li></ul>
<p>The piece finds the leaning books on the finished mesh (a book whose largest face, a board, is tilted between 3° and 80°) and the upright neighbour on the side its top leans toward, on the same shelf. It takes the plane of the leaning board's outer face off the mesh and measures how far the neighbour's deepest vertex sits behind it, as a band of 0.3–2.0 mm. Both lean at 0.80 mm.</p>
<p>A plane, not the cover solid: the board is 2.8 mm thick, and a head edge driven right through it lies in the hollow of the book, outside the cover again, so a solid test reads a deep cut as no contact at all. That is how the first <code>--deep-lean</code> passed.</p>
<p><code>--air-lean</code> and <code>--deep-lean</code> are the falsifiers built for exactly this. One stops each leaning book 3 mm short of its neighbour, the other drives it 4.5 mm in. Both exit 22 while every seat, the envelope and the book overlap budget still pass.</p>
<h2 id="budgets">Budgets<a class="anchor" href="#budgets" aria-label="Link to this section">#</a></h2>
<p>Declared in the script as named constants, recomputed from the generated mesh. Measured values are from Blender 5.2.1; see the cross-version table below.</p>
<div class="table-wrap"><table><thead><tr><th scope="col">Budget</th><th scope="col">Band</th><th scope="col">Measured</th></tr></thead><tbody><tr><td>Base triangles</td><td>10400–11400</td><td>10908</td></tr><tr><td>LOD1 ratio</td><td>0.32–0.62</td><td>0.5000</td></tr><tr><td>LOD2 ratio</td><td>0.10–0.35</td><td>0.2189 (0.2198 on 4.5 and 5.1)</td></tr><tr><td>Material slots</td><td>exactly 5, distinct</td><td>5</td></tr><tr><td>Wood / cloth / leather faces</td><td>≥ 300 / 1850 / 960</td><td>338 / 2050 / 1066</td></tr><tr><td>Paper / gilt faces</td><td>≥ 200 / 1780</td><td>228 / 1976</td></tr><tr><td>UV bounds</td><td>inside 0..1</td><td>(0.0004, 0.0004)–(0.9996, 0.9996)</td></tr><tr><td>UV AABB overlap</td><td>≤ 1e-5</td><td>0.000000</td></tr><tr><td>Outer AABB</td><td>0.972 × 0.332 × 1.176 m ± 0.020</td><td>0.9720 × 0.3320 × 1.1760</td></tr><tr><td>Collider triangles</td><td>≤ 200</td><td>68</td></tr><tr><td>Normal bake</td><td><code>{'FINISHED'}</code> with image data</td><td><code>{'FINISHED'}</code>, <code>has_data=True</code></td></tr><tr><td>glTF export</td><td>file written, non-empty</td><td>~786 kB</td></tr><tr><td>Hygiene</td><td>all zero</td><td>loose 0/0, non-manifold 0, zero-area 0, doubles 0, n-gons 0, coplanar cross-shell pairs 0</td></tr><tr><td>Grounded AABB</td><td>\</td><td>zmin\</td><td>≤ 1e-4</td><td>0.00000</td></tr><tr><td>Named sides</td><td>2 sides, each zmin ≤ 1e-4</td><td>2 at 0.00000</td></tr><tr><td>Dado</td><td>4 cross members, each ≥ 5 mm into both sides and ≥ 6 mm clear of the far face</td><td>8.00 mm in, 14.00 mm clear</td></tr><tr><td>Page block</td><td>38 books, one block and two bands each; every block corner 0.3–1.2 mm inside its boards</td><td>0.60 mm</td></tr><tr><td>Book seat</td><td>38 books, each 0.5–3.6 mm into the shelf or the book it stands on</td><td>1.00–3.16 mm</td></tr><tr><td>Band seat</td><td>inner face 0.1–0.8 mm inside the spine, outer face ≥ 0.4 mm proud</td><td>0.29 mm in, 0.80 mm proud</td></tr><tr><td>Headroom</td><td>every book ≥ 20 mm under the member above</td><td>44.36 mm</td></tr><tr><td>Size spread</td><td>thickest / thinnest ≥ 2.5; tallest / shortest ≥ 1.5</td><td>2.900 / 1.645</td></tr><tr><td>Lean contact</td><td>2 leaning and 7 lying books; each neighbour's head edge 0.3–2.0 mm behind the leaning board</td><td>0.80 mm</td></tr><tr><td>Book overlaps</td><td>0, book against book and against the carcass, designed contacts exempt</td><td>0</td></tr><tr><td>Edge treatment</td><td>right-angle wood edges</td><td>0</td></tr></tbody></table></div>
<p>Real-world size: 0.97 m wide over the cornice, 1.18 m tall and 0.33 m deep. Each compartment is 318–348 mm clear, and the books run from a 186 mm octavo to a 305 mm folio.</p>
<h2 id="construction">Construction<a class="anchor" href="#construction" aria-label="Link to this section">#</a></h2>
<ul><li><strong>Carcass.</strong> Two full-height sides carry everything and are the only named supports. The plinth, the base and the two shelves are each housed <code>DADO</code> (8 mm) into both sides and stop 14 mm short of the outer faces. The plinth stands 18 mm back from the base's front and 4 mm off the floor, so only the sides ground. The top is seated over the sides and the back boards; the cornice steps 10 mm out past it and is seated <code>CORN_BITE</code> into it, its back held 4 mm short of the top's back so the two do not share a plane. Every board is chamfered at 2.5 mm with <code>material=</code> pinned to wood, edges sorted by index.</li><li><strong>Back boards.</strong> Five vertical boards, lapped 2 mm into one another and every other one stepped forward 1.5 mm, as on <code>apothecary-shelf</code>.</li><li><strong>Covers.</strong> One shell per book: a U of front board, half-round spine and back board, extruded up the height (<code>SPINE_ARC</code> = 6 segments). The boards are tangent to the spine, so it reads round and the boards flat. Every edge over 40° is chamfered 0.8 mm; the spine facets (30°) are not, and shade smooth.</li><li><strong>Page blocks.</strong> A block inside the U, <code>SQUARE</code> (4 mm) short of the cover at head, tail and fore-edge, biting <code>PAGE_BITE</code> (0.6 mm) into both boards. Its back stops 1.5 mm short of the line where boards meet spine, which is where the band ends lie.</li><li><strong>Gilt bands.</strong> Two per book, built on the cover's own outer chain round the spine: every band vertex sits on a cover vertex's normal, inner face 0.3 mm inside the spine and outer face 0.8 mm proud.</li><li><strong>Standing books.</strong> Set along each shelf with a 2.5–4.5 mm gap, spines a stepped 6–14 mm back from the shelf front, each seated a stepped 1.0–3.3 mm into the shelf. Each stands a degree or two off square, in a four-step cycle (−2.4°, −0.8°, 0.8°, 2.4°).</li><li><strong>Stacks.</strong> Books laid on a board, spine out, yawed ±3° alternately and shifted a few millimetres. The bottom one seats into the shelf; each one above takes a 1.0–1.4 mm seat into the board below it.</li><li><strong>Leaning books.</strong> Turned about Y by 18° (bottom shelf, onto the book on its left) and 22° (middle shelf, onto the book on its right), seated on the shelf by the lowest vertex of the chamfered cover. Then the leaning book (or, leaning right, its neighbour) is slid along the shelf until the neighbour's deepest vertex is <code>LEAN_BITE</code> (0.8 mm) behind the leaning board's outer face. Each leaning book is taller than its neighbour's head divided by the cosine of its lean, so the head edge meets the board and not its top corner.</li></ul>
<h2 id="findings-the-budgets-forced">Findings the budgets forced<a class="anchor" href="#findings-the-budgets-forced" aria-label="Link to this section">#</a></h2>
<ul><li><strong>Coplanar page blocks and shelves.</strong> The first page blocks sat 3 mm short of the cover's tail, and one book seated 2.98 mm into its shelf put its page block's underside 0.02 mm off the shelf top: a coplanar pair. The square is now 4 mm, clear of every seat.</li><li><strong>Every spine has the same facet angles.</strong> A half-round spine of six facets has the same six facet normals on every book. Square to the shelf, two neighbours share a facet plane whenever their offsets happen to line up, and the uniform and crowded falsifiers did so (five and twelve coplanar pairs). Each upright now stands a degree or two off square in a four-step cycle. A half-degree cycle was not enough: on a 45° chamfer the normals differ by half the yaw, inside the 1e-4 parallel tolerance.</li><li><strong>Planes facing the front.</strong> Spine lines, band ends and fore-edges face the shelf front, and two neighbours landed band ends on one plane. Each book is stepped back 0.9 mm at a time until none of its front-facing planes is within 0.4 mm of a neighbour's.</li><li><strong>A stacked book on a page block's plane.</strong> A book stacked on another with the running seat (up to 3.3 mm) could land its underside on the plane of the lower book's page block, 2.2 mm inside its board. A stacked book now takes its own 1.0–1.4 mm seat.</li><li><strong>Matching parts to books.</strong> Page blocks were first matched to the cover nearest their centroid. In a stack, the centroid of a thick book's page block is nearer the board of the book above than its own. Parts are now matched on the mean distance of all their vertices.</li><li><strong>Deep lean through the board.</strong> Measured against the cover solid, a head edge driven 4.5 mm into a 2.8 mm board came out in the hollow of the leaning book and read as no contact, so <code>--deep-lean</code> exited 0. The contact is now measured against the plane of the board's outer face.</li><li><strong>Black gilt.</strong> Fully metallic bands facing the camera mirrored the dark stage and read black except at their edges. The gilt is half metallic.</li></ul>
<h2 id="conventions-walked">Conventions walked<a class="anchor" href="#conventions-walked" aria-label="Link to this section">#</a></h2>
<p>Every convention in <code>showcase/README.md</code>, and whether it applies here.</p>
<div class="table-wrap"><table><thead><tr><th scope="col">Convention</th><th scope="col">Applies</th><th scope="col">How</th></tr></thead><tbody><tr><td>Deterministic, budgets declared, assertions recompute</td><td>yes</td><td>no RNG; every value above is read off the mesh</td></tr><tr><td>Falsifier fails the budget it targets</td><td>yes</td><td>table below, proven on all three binaries</td></tr><tr><td>Hygiene incl. cross-shell coplanar</td><td>yes</td><td>exit 15; square, yaw cycle, front-plane step and stack seat chosen to keep it at 0</td></tr><tr><td>Named supports</td><td>yes</td><td>the two sides (<code>--float-side</code>); the plinth stops 4 mm off the floor</td></tr><tr><td>Joint-fit budgets</td><td>yes</td><td>dado bite and far-face clearance per cross member (<code>--short-shelves</code>)</td></tr><tr><td>A member is tenoned into its seat</td><td>yes</td><td>top over sides and back boards, cornice into the top, back boards into the base</td></tr><tr><td>A platform bears on something</td><td>yes</td><td>every shelf housed in both sides and biting the back boards</td></tr><tr><td>Carried parts bite their bearers</td><td>yes</td><td>books into shelves and into the book below (<code>--float-books</code>)</td></tr><tr><td>A joint bites; touching is not joining</td><td>yes</td><td>page blocks into their boards (<code>--loose-pages</code>); the lean contact as a band</td></tr><tr><td>Bands on a curved host are built on the host's arc</td><td>yes</td><td>gilt bands on the spine's own chain (<code>--float-bands</code>)</td></tr><tr><td>A leaning prop rests on something</td><td>yes</td><td>the lean contact, exit 22 (<code>--air-lean</code>, <code>--deep-lean</code>)</td></tr><tr><td>Scattered parts do not interpenetrate</td><td>yes</td><td>exit 23 (<code>--crowd-books</code>), designed contacts exempt and counted</td></tr><tr><td>Scatter varies in size</td><td>yes</td><td>thickness and height spread, exit 21 (<code>--uniform-books</code>)</td></tr><tr><td>The subject hangs where it can be seen / headroom</td><td>yes</td><td>every book under the member above, exit 20 (<code>--tall-book</code>)</td></tr><tr><td>Edge treatment: no right angles</td><td>yes</td><td>exit 24 (<code>--sharp-shelf</code>), wood only; covers chamfered 0.8 mm by construction</td></tr><tr><td>Aim an edge falsifier at one member</td><td>yes</td><td>one shelf left square: 12 edges</td></tr><tr><td>Sort bmesh operator inputs</td><td>yes</td><td>bevel edges sorted by index, carcass and covers</td></tr><tr><td>A plank wall is boards</td><td>yes</td><td>five lapped back boards</td></tr><tr><td>Identical boards read as CG</td><td>yes</td><td>per-board <code>PlankTone</code> and <code>GrainDir</code>; per-book <code>Tint</code></td></tr><tr><td>Variation goes into surface, never into function</td><td>yes</td><td>sizes, tints, gaps and yaw vary; shelf pitch and seats are budgets</td></tr><tr><td>Shading is part of the model</td><td>yes</td><td>spines smooth (round); every edge over 35° hard, so boards and chamfers read crisp</td></tr><tr><td>One substance, one slot</td><td>yes</td><td>wood, cloth, leather, paper, gilt</td></tr><tr><td>Iron is not chrome</td><td>n/a</td><td>no iron; gilt is half metallic, roughness 0.45</td></tr><tr><td>Bake texels per UV cell</td><td>measured, not a budget</td><td>1024 px over a 76-cell grid, about 13 px per cell</td></tr><tr><td>The bake cage is narrower than the nearest neighbour</td><td>yes</td><td><code>CAGE_EXTRUSION</code> 0.01 m</td></tr><tr><td>Level on the stage; stage 60 m</td><td>yes</td><td>turned about Z only; 60 m floor and wall</td></tr><tr><td>Keep a falsifier's envelope still</td><td>yes</td><td>every falsifier leaves the AABB unchanged</td></tr><tr><td>Mirror symmetry, plumb, rope, masonry, roofs, rings, terrain, vessels</td><td>no</td><td>the piece has none of these</td></tr></tbody></table></div>
<h2 id="falsifiers">Falsifiers<a class="anchor" href="#falsifiers" aria-label="Link to this section">#</a></h2>
<p>Each breaks one pipeline stage so a <strong>named</strong> budget fails. All fifteen were run on 4.5.11, 5.1.2 and 5.2.1 and exited the same declared code on all three.</p>
<div class="table-wrap"><table><thead><tr><th scope="col">Flag</th><th scope="col">Target budget</th><th scope="col">Breaks</th><th scope="col">Exit</th></tr></thead><tbody><tr><td><code>--skip-decimate</code></td><td>LOD1 ratio</td><td>drops the DECIMATE modifiers, LOD1 ratio goes to 1.0000</td><td>9</td></tr><tr><td><code>--stray-vert</code></td><td>mesh hygiene</td><td>adds one loose vertex inside the carcass</td><td>15</td></tr><tr><td><code>--lift-z</code></td><td>grounded zmin</td><td>lifts the whole mesh 50 mm</td><td>16</td></tr><tr><td><code>--float-side</code></td><td>named sides</td><td>lifts the left side 5 mm; the right side still grounds the AABB</td><td>16</td></tr><tr><td><code>--short-shelves</code></td><td>dado bite</td><td>stops the two shelves 4 mm short of the sides; −4.0 mm</td><td>17</td></tr><tr><td><code>--loose-pages</code></td><td>page-block bite</td><td>builds every page block 0.9 mm clear of its boards; −0.9 mm</td><td>17</td></tr><tr><td><code>--float-books</code></td><td>book seat</td><td>lifts every book 6 mm; −5.0 mm</td><td>18</td></tr><tr><td><code>--float-bands</code></td><td>band seat</td><td>builds every band 1.1 mm off its spine; −1.1 mm</td><td>18</td></tr><tr><td><code>--tall-book</code></td><td>headroom</td><td>stretches one middle-shelf folio 1.20 into the shelf above; −3.9 mm</td><td>20</td></tr><tr><td><code>--uniform-books</code></td><td>size spread</td><td>one height and depth, thickness within ±1.5 %; 1.030 / 1.000</td><td>21</td></tr><tr><td><code>--air-lean</code></td><td>lean contact</td><td>stops each leaning book 3 mm short of its neighbour; −3.0 mm</td><td>22</td></tr><tr><td><code>--deep-lean</code></td><td>lean contact</td><td>drives each leaning book 4.5 mm into its neighbour; 4.5 mm</td><td>22</td></tr><tr><td><code>--crowd-books</code></td><td>book overlaps</td><td>closes the top shelf's gaps to −4.1 mm; 11 overlaps</td><td>23</td></tr><tr><td><code>--sharp-shelf</code></td><td>edge treatment</td><td>leaves the top shelf unchamfered; 12 right-angle edges</td><td>24</td></tr></tbody></table></div>
<h2 id="exit-codes">Exit codes<a class="anchor" href="#exit-codes" aria-label="Link to this section">#</a></h2>
<p>File-local and sequential. <code>9</code> is a valid check code. <code>1</code> is the FATAL wrapper — a crash, never a named check. <code>19</code> (plumb and real-world size) is reserved across pieces and unused here.</p>
<div class="table-wrap"><table><thead><tr><th scope="col">Code</th><th scope="col">Meaning</th></tr></thead><tbody><tr><td>0</td><td>Success</td></tr><tr><td>1</td><td>Uncaught exception (FATAL wrapper)</td></tr><tr><td>2</td><td>argparse / usage</td></tr><tr><td>3</td><td>Mesh did not build, or has no UV layer</td></tr><tr><td>4</td><td>Base triangle count outside band</td></tr><tr><td>5</td><td>Material slots, or a material's face floor</td></tr><tr><td>6</td><td>UVs outside 0..1</td></tr><tr><td>7</td><td>UV AABB overlap above tolerance</td></tr><tr><td>8</td><td>Outer AABB off declared size</td></tr><tr><td>9</td><td>LOD1 or LOD2 ratio outside band (<code>--skip-decimate</code>)</td></tr><tr><td>10</td><td>Framing gate (<code>examples/gallery_framing.py</code>, render path only)</td></tr><tr><td>11</td><td>Collider triangles above ceiling</td></tr><tr><td>12</td><td>Normal bake failed or produced no image data</td></tr><tr><td>13</td><td>glTF export missing or empty</td></tr><tr><td>14</td><td><code>--output</code> produced no file</td></tr><tr><td>15</td><td>Mesh hygiene (<code>--stray-vert</code>)</td></tr><tr><td>16</td><td>Grounded zmin, or a side floating (<code>--lift-z</code>, <code>--float-side</code>)</td></tr><tr><td>17</td><td>Dado or page-block bite, or a book without one block and two bands (<code>--short-shelves</code>, <code>--loose-pages</code>)</td></tr><tr><td>18</td><td>Book or band seat (<code>--float-books</code>, <code>--float-bands</code>)</td></tr><tr><td>20</td><td>Headroom under the member above (<code>--tall-book</code>)</td></tr><tr><td>21</td><td>Size spread below floor (<code>--uniform-books</code>)</td></tr><tr><td>22</td><td>Lean contact, or leaning / lying count (<code>--air-lean</code>, <code>--deep-lean</code>)</td></tr><tr><td>23</td><td>Books overlap each other or the carcass (<code>--crowd-books</code>)</td></tr><tr><td>24</td><td>Right-angle wood edges (<code>--sharp-shelf</code>)</td></tr></tbody></table></div>
<h2 id="run-it">Run it<a class="anchor" href="#run-it" aria-label="Link to this section">#</a></h2>
<pre><code># Budget check, no render.
blender --background --python bookshelf.py --
# Falsifier: each leaning book stops short of its neighbour. Must exit 22.
blender --background --python bookshelf.py -- --air-lean
# Falsifier: each leaning book cuts into its neighbour. Must exit 22.
blender --background --python bookshelf.py -- --deep-lean
# Render the gallery still (EEVEE; --engine cycles on a GPU-less host).
blender --background --python bookshelf.py -- --output bookshelf.webp</code></pre>
<p>Smoke runs the check-only path. It does not pass <code>--output</code> or any falsifier.</p>
<h2 id="cross-version-measurements">Cross-version measurements<a class="anchor" href="#cross-version-measurements" aria-label="Link to this section">#</a></h2>
<div class="table-wrap"><table><thead><tr><th scope="col">Value</th><th scope="col">4.5.11</th><th scope="col">5.1.2</th><th scope="col">5.2.1</th></tr></thead><tbody><tr><td>Base triangles</td><td>10908</td><td>10908</td><td>10908</td></tr><tr><td>LOD1 / LOD2 tris</td><td>5454 / 2398</td><td>5454 / 2398</td><td>5454 / 2388</td></tr><tr><td>Face counts (wood / cloth / leather / paper / gilt)</td><td>338 / 2050 / 1066 / 228 / 1976</td><td>same</td><td>same</td></tr><tr><td>Outer AABB</td><td>0.9720 × 0.3320 × 1.1760</td><td>same</td><td>same</td></tr><tr><td>Collider tris</td><td>68</td><td>68</td><td>68</td></tr><tr><td>Headroom / spread / lean</td><td>44.36 mm / 2.900, 1.645 / 0.80 mm</td><td>same</td><td>same</td></tr><tr><td>glTF bytes</td><td>785836</td><td>785836</td><td>785828</td></tr></tbody></table></div>
<p>LOD2 differs by ten triangles on 5.2 (DECIMATE COLLAPSE, the known divergence; the gate is a ratio band) and the glTF size by 8 bytes (exporter metadata, not a budget). Every other value is identical.</p>
</section>
<section class="detail-section src" id="source">
<h2>Source</h2>
<div class="src-meta">
<code>showcase/bookshelf/bookshelf.py</code>
<span>1701 lines · <a href="https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/showcase/bookshelf/bookshelf.py">View on GitHub →</a></span>
</div>
<div class="code" data-lines="1701">
<pre class="gutter" aria-hidden="true">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890