GameCult.Geometry.Csg/spikes/boolean-weld/py/compose4.py
Meta Vens 0f9a4071a8 Spike boolean-weld round 4: UV0 seam protection, end-state guard, results, renders and note
- Weld steps never drag UVs across a hull UV0 seam: seam crossings and seam vertices are protected like corners,
  flips stay inside one source UV island.
- Short seam merge and slide are judged by their end state (local worst angle), per target r4's wording.
- Stand-in UV0 on the hand cage (export_uv.py, hull_uv.obj); bevel strip UVs measured on loop strips only.
- Note: round-4 section with the flat-split before/after pair first, tables per call, open questions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 04:23:29 +02:00

15 lines
968 B
Python

"""Compose render sheets: <case>_<tag>.png files side by side per case, labelled, saved as JPEG.
Usage: compose4.py <render-dir> <out-dir> [prefix]"""
import sys, os
from PIL import Image, ImageDraw
rd, out = sys.argv[1], sys.argv[2]; pre = sys.argv[3] if len(sys.argv) > 3 else ''; os.makedirs(out, exist_ok=True)
rows = {}
for f in sorted(x for x in os.listdir(rd) if x.endswith('.png')):
case, tag = f[:-4].rsplit('_', 1); rows.setdefault(case, []).append((tag, f))
for case, items in rows.items():
ims = [Image.open(os.path.join(rd, f)).convert('RGB') for t, f in items]
W = sum(i.width for i in ims); H = max(i.height for i in ims) + 28
c = Image.new('RGB', (W, H), (255, 255, 255)); d = ImageDraw.Draw(c); x = 0
for (t, f), im in zip(items, ims):
c.paste(im, (x, 28)); d.text((x + 8, 6), f'{case}: {t}', fill=(0, 0, 0)); x += im.width
c.save(os.path.join(out, pre + case + '.jpg'), quality=82); print(case, [t for t, f in items])