#!/usr/bin/env bash # Rebuild everything .gitignore leaves out, including the committed A/B sheets. # Order matters only in that the sheets need the runs first; the 160 mm body is # last of the meshes because it is the only expensive one (~3 GB RSS, ~2 min). set -euo pipefail cd "$(dirname "$0")" SCAN=~/Downloads/food_0015_2k_sc65C6.zip CUBE=(blender -b --factory-startup -P make_rice_cube.py --) PROC=(--height tex_proc/rice_height_16bit.png --sidecar tex_proc/rice_maps.json) # 1. The scanned baseline's source: external asset, not ours. unzip -o "$SCAN" -x "__MACOSX/*" -d tex/ # 2. Procedural map set. 14 s, deterministic from SEED in the script. python3 make_rice_texture.py python3 preview_maps.py # 3. The one that was liked: 40 mm, 0.2 mm voxel, relief 0.6 x grain. "${CUBE[@]}" "${PROC[@]}" --patch 60 --voxel 0.2 --relief-ratio 0.6 --out out_calm # 4. The 160 mm body with 8 mm fillets: 7.68M triangles. "${CUBE[@]}" "${PROC[@]}" --size 160 --fillet 8 --patch 60 --voxel 0.2 \ --relief-ratio 0.6 --out out_160 # 5. Baselines kept only as A/B panes. "${CUBE[@]}" "${PROC[@]}" --patch 60 --voxel 0.3 --out out # fusing, coarse "${CUBE[@]}" "${PROC[@]}" --patch 60 --voxel 0.2 --out out_crisp # fusing, fine "${CUBE[@]}" --out out_scan # scanned rice # 6. The comparison sheets that are committed. python3 contact_sheet.py out # variant ladder python3 compare.py --out out/fusing_ab.png \ --title "fusing: voxel 0.3 mm vs 0.2 mm (everything else identical)" \ "voxel 0.3 · 210k tris · 10.5 MB=out/preview_g5_00.png" \ "voxel 0.2 · 480k tris · 24 MB=out_crisp/preview_g5_00.png" python3 compare.py --out out/relief_ab.png \ --title "relief A/B: 0.90 x grain (4.48 mm) vs 0.60 x grain (3.00 mm)" \ "relief 4.48 mm · ratio 0.90=out_crisp/preview_g5_00.png" \ "relief 3.00 mm · ratio 0.60=out_calm/preview_g5_00.png" python3 compare.py --out out/size_ab.png --crop 0.36,0.26,0.70,0.68 \ --title "same rice, body scaled: 40 mm cube / 4 mm fillet vs 160 mm cube / 8 mm fillet" \ "40 mm · fillet 4 · 480k tris=out_calm/preview_g5_00.png" \ "160 mm · fillet 8 · 7.68M tris=out_160/preview_g5_00.png" python3 compare.py --out out/scan_vs_procedural.png \ --title "rice cube — scanned vs procedural rice" \ "scanned · grain 6.5 mm=out_scan/preview_g6_50.png" \ "procedural · grain 5.0 mm=out_calm/preview_g5_00.png"