Weight Rack

showcase/weight-rack/

A procedural home-gym strength set — a half rack of punched, numbered square uprights on bolted feet with rubber pads, side rails on bolted flanges, a pull-up bar, J-hooks with UHMW saddles and spotter arms on pull pins seated in the holes, plate-storage horns, an Olympic barbell with a knurled shaft, collars and sleeves loaded with bumpers (steel hubs, raised rims and numerals) and cast-iron change plates behind coiled spring clips, and two hex dumbbells — through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.

Rendered headless by the showcase piece itself. Select it to enlarge.

witnesses Recomputed: 44264 tris, twelve materials with 4758 powder-coat, 3036 bore, 4196 zinc, 3348 chrome, 256 knurl, 1328 rubber, 104 UHMW, 3112 numeral, 864 blue, 576 yellow, 576 green and 2240 cast-iron faces, UVs in 0..1 with zero AABB overlap, outer AABB 2.200×1.636×2.092 m, zmin 0, hygiene 0 including zero coplanar cross-shell pairs, all four pads and four dumbbell heads on the floor, all four pull pins on their holes' axes (0.000 mm) 7.0 mm deep, the bar seated in both J-hook saddles (−0.20 mm) and level (0.0000°) at 2.200 m, 0.450 m bumpers, twelve plates on six sleeves within 0.80 mm of their axes with every gap −0.50 mm (band −0.8 to −0.2 mm), the loaded bar's mass centre 0.002 mm off its midpoint (tol 2 mm), one connected rack plus two dumbbells, LOD ratios in band, collider 472 tris, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z 16; --float-foot 16; --offset-pin 17; --float-bar 18; --hook-high 19; --gap-plate 20; --odd-load 21; --loose-horn 22.

category Sports

tags mesh export showcase

blender --background --python showcase/weight-rack/weight_rack.py --

A showcase piece, not an example, and the third in the sports category. It builds a procedural home-gym strength set: a half rack holding a loaded Olympic barbell, with plates on its storage horns and two hex dumbbells on the floor.

The layout is solved from named constants. The bar rests where the two saddles put it: its axis is set from each liner's top plus the shaft radius, less a 0.2 mm bite. Every plate hangs on its sleeve, its bore resting on the sleeve's top, so its centre sits 0.8 mm below the axis. Each hub bites 0.5 mm into the plate or collar inside it, and the clip bites the last plate. Neighbouring bores are turned a third of a segment apart, so no bore facet shares a plane with the sleeve or with the next plate.

It asserts budget conformance of the generated result. It does not witness an API contract. "It rendered without error" is not a check.

Composes skills mesh-editing-and-bmesh, bake-high-to-low, depsgraph-and-evaluated-data, engine-export-presets, and snippets bake_normal_high_to_low.py, setup_bake_target_image.py, lod_chain.py / decimate_to_budget.py, convex_hull_collider.py, export_preset_unity.py (helpers copied inline, not imported).

Intended size: 2.20 m across the bar, 1.64 m from the dumbbells to the rear foot caps, 2.09 m to the top of the upright caps. The bar sets the width, the dumbbells and the rear feet the depth, and the caps the height. The origin is under the rack, so it lands on its pads.

Budgets#

Every budget is declared as a named constant. Every gate recomputes its value from the mesh, materials, UVs, evaluated LOD, collider, or export file.

AxisDeclaredMeasured (5.2.1)
Base triangles43500–4500044264
LOD1 ratio0.32–0.62 of base0.5000
LOD2 ratio0.10–0.35 of base0.2197
Materialsexactly 12 distinct; ≥4420 powder coat, ≥2820 bore, ≥3900 zinc, ≥3110 chrome, ≥235 knurl, ≥1230 rubber, ≥96 UHMW, ≥2890 numeral, ≥800 blue, ≥530 yellow, ≥530 green, ≥2080 cast-iron faces12 slots; 4758 / 3036 / 4196 / 3348 / 256 / 1328 / 104 / 3112 / 864 / 576 / 576 / 2240
UVsin 0..1, AABB overlap ≤ 1e-5in range, overlap 0
Outer AABB(2.200, 1.636, 2.092) m ± 0.01(2.2000, 1.6364, 2.0920), zmin 0
Collider tris≤ 640472
Exportwritten, size > 0, removed after measuring3295024 / 3295024 / 3295016 bytes (4.5.11 / 5.1.2 / 5.2.1)

The collider is the convex hull of the whole set. Its count is carried by the plates' rims and the dumbbell heads, which are the hull's outline.

Every falsifier leaves the triangle count at 44264: they move parts or swap a plate for one of the same topology, never add or remove geometry.

DECIMATE COLLAPSE triangle counts are not identical across Blender series, so the LOD gate is a ratio band, not an exact count. Bake pixels are stochastic, so the bake gate is has_data plus operator FINISHED, not byte-identity. Construction uses no RNG; two default runs print identical measurements.

Hygiene#

Recomputed from the generated mesh, not asserted about the script.

AxisDeclaredMeasured
Non-manifold edges00
Loose verts / edges0 / 00 / 0
Doubles merged at 1e-500
Zero-area faces00
N-gons00
Coplanar cross-shell face pairs (KD range 0.05 m, plane ε 1e-4)00
Grounded: zminwithin 1e-4 of 00.0000
Supports: each of the 4 rubber pads and each of the 4 dumbbell heads has its own zminwithin 1e-4 of 0all 0

The first draft measured 264 coplanar pairs. The plates on one sleeve all hung with the same bore cylinder, in the same phase as the sleeve, so their bore facets shared planes with the sleeve and with each other. A bumper numeral's top landed on the plane of the iron plate's face, and one hole numeral's wall landed on the J-hook's side. The fixes changed the model: bores are turned a third of a segment apart, the numerals stand 0.8 mm proud instead of 1.2, and the J-hook is 1 mm narrower. Each digit and each neighbouring numeral also sits on its own plane (0.13 mm steps), alternate hole numbers are offset 0.3 mm across the face, and bolts in a group are staggered along their axes.

Pins, bar, plates, balance and assembly#

AxisDeclaredMeasured
Pins coaxial: each of the 4 pull pins (vertex mean of the lathe) against the nearest punched hole's centre (vertex mean of its pocket floor), and its depth past the face4 pins; ≤ 0.5 mm off the axis; depth 4–9.5 mm0.000 mm on all four; 7.0 mm
Bar seated: from the bar axis over each J-hook liner, a ray down to the liner minus the same ray to the bar's own underside−0.8 to +0.3 mm on both−0.20 mm, −0.20 mm
Level and size: the bar axis (PCA) against horizontal; bar length along it; upright height; every bumper's diametertilt ≤ 0.05°; 2.200, 2.080, 0.450 m, each ± 0.0030.0000°; 2.2000, 2.0800, 0.450
Plates seated: each plate assigned to the nearest sleeve axis (bar sides by collar face, horns by backstop face read off the mesh); its offset from that axis; along the axis the gap from the stop face to the first plate, plate to plate, and last plate to the clipcounts 3, 3, 2, 1, 2, 1; offset ≤ 1 mm; every gap −0.8 to −0.2 mmas declared; 0.80 mm; 14 gaps all −0.50 mm
Load balance: the loaded bar's mass centre (shell volumes × density: bumpers 1800 kg/m³, cast iron 7200, steel 7850) along its axis from its midpoint≤ 2 mm0.002 mm (96.4 kg; 37.86 kg each side)
One connected rack (union of shells whose BVH trees overlap), plus the two loose dumbbells3 components3 (222 shells)

A barbell on J-hooks is only safe if the hooks are pinned through the upright and the bar sits in both saddles. The pin budget reads the hole from the mesh, not from the constant that placed it. The bar is set level by construction, so the level budget is what catches a hook hung one hole high. A plate that is not seated walks along the sleeve. An unequal load tips the bar off the hooks. The pound rating is measured nowhere; it is printed where real bumpers print it.

Falsifiers#

Each falsifier violates one named budget. Every one was run on 5.2.1 and exited its declared code. None moves the envelope beyond 0.2 mm or the triangle count, and every budget checked before the target stayed green.

FlagBudget violatedExit
--skip-decimateLOD1 ratio band (measured 1.0000)9
--stray-vertloose vertex count is 0 (measured 1, placed inside the envelope)15
--lift-zbounding box zmin is 0 (measured 0.05000)16
--float-footevery pad and dumbbell head on the floor (left front pad 3 mm up: its zmin 0.00300, the rest 0)16
--offset-pinpins coaxial with their holes (left spotter and its pin 12 mm up: 0.012 m off the hole axis)17
--float-barbar seated in both saddles (bar, plates and clips 5 mm up: shaft-to-liner +0.0048 m on both)18
--hook-highbar level (right J-hook one hole higher, bar resting across both saddles: tilt 2.644°)19
--gap-plateplates seated (right iron plate and clip 8 mm out along the sleeve: gap +0.0075 m)20
--odd-loadload balance (left 5 kg iron plate swapped for 2.5 kg: mass centre 0.0226 m off the midpoint)21
--loose-hornone connected rack (upper-left horn with its weld plate, bolts and plates 10 mm off the upright: 4 components)22

--offset-pin moves the spotter, not a J-hook, so the bar stays seated and level. --float-bar also splits the assembly, but seating (18) is checked first. --hook-high keeps every pin in a hole (the J-hook moves one full pitch) and both saddle gaps inside their band (−0.215 mm); the bar end moves 0.2 mm in x, inside the bounding-box tolerance. --gap-plate moves the load's mass centre 0.4 mm, inside the balance tolerance. --odd-load keeps every plate seated, since the clip moves in against the thinner plate.

Run#

blender --background --python weight_rack.py --
blender --background --python weight_rack.py -- --skip-decimate
blender --background --python weight_rack.py -- --stray-vert
blender --background --python weight_rack.py -- --lift-z
blender --background --python weight_rack.py -- --float-foot
blender --background --python weight_rack.py -- --offset-pin
blender --background --python weight_rack.py -- --float-bar
blender --background --python weight_rack.py -- --hook-high
blender --background --python weight_rack.py -- --gap-plate
blender --background --python weight_rack.py -- --odd-load
blender --background --python weight_rack.py -- --loose-horn
blender --background --python weight_rack.py -- --output rack.png

Smoke passes no flags.

The hero turns the piece HERO_YAW_DEG (28°), so the loaded left sleeve, the left horns and the spotter arms come toward the lens, and the rear uprights stand clear of the front ones. The wall stands 3.2 m behind the rack, and the warm wedge pools on it.

Exit codes#

File-local. 9 is a valid check code. 10 is reserved for gallery_framing.check_framing on the --output path. 15–19 are the hygiene and joint-fit family. 20–22 are file-local. 23 is the asset-quality floor on the render path: check_asset_quality returns 11, which this piece already spends on the collider ceiling, so the call site remaps it.

CodeMeaning
0Success
1Uncaught exception (FATAL wrapper)
2argparse / usage
3Mesh did not build / no UV layer
4Base triangle count outside range
5Material count ≠ 12 distinct slots, or a face-count floor missed
6UVs outside 0..1
7UV AABB overlap above tolerance
8World AABB off declared outer size
9LOD ratio band (--skip-decimate lands here)
10Framing gate (render path only)
11Collider triangle count above ceiling
12Bake did not finish or image has no data
13Export file missing or empty
14--output produced no file
15Mesh hygiene: loose, non-manifold, zero-area, doubles, n-gons, coplanar cross-shell pairs
16Not grounded: bounding box zmin off 0, or a pad or dumbbell head off the floor, or not 4 of each (--lift-z, --float-foot)
17Pins: not 4, one off its hole's axis, or inserted outside its depth band (--offset-pin)
18Bar not seated in both J-hook saddles (--float-bar)
19Bar tilted, or bar length, upright height or a bumper diameter off (--hook-high)
20Plates: wrong count on a sleeve, one off every sleeve axis, or a gap along a sleeve outside its band (--gap-plate)
21Load balance: the loaded bar's mass centre off its midpoint (--odd-load)
22Assembly: not one connected rack plus two dumbbells (--loose-horn)
23Asset-quality floor (render path only; remapped from 11)

Source

showcase/weight-rack/weight_rack.py View the script on GitHub →
A red home-gym half rack holding an Olympic barbell loaded with blue and yellow bumpers on J-hooks, plates on storage horns and two hex dumbbells, on a dark studio floor.