#!/usr/bin/env python3 """thresh.py MODE file.raw - where does the card round a texel coordinate up? For each drawn pixel, the model coordinate c = s*64 (fixed-point replay); 'up' when the card's texel is floor(c)+1. Prints, per bucket of frac(c), the share rounded up. Claude Opus 5.5.""" import sys, io, contextlib, math src = open("texmap-check.py").read().split('fixed_ok = exact_ok')[0] with contextlib.redirect_stdout(io.StringIO()): exec(src) B = 20; up = [0] * B; tot = [0] * B; other = 0 for (x, y), (fs, ft, es, et) in exp.items(): v = pix(x, y) for c, h in ((fs * 64, v & 63), (ft * 64, (v >> 6) & 63)): f = c - math.floor(c); b = min(int(f * B), B - 1) if h == math.floor(c) & 63: tot[b] += 1 elif h == (math.floor(c) + 1) & 63: tot[b] += 1; up[b] += 1 else: other += 1 print(" ".join("%.2f:%3d%%" % (i / B, 100 * up[i] // max(tot[i], 1)) for i in range(B)), " other", other)