feat(lena-hands): exp09 graded cross-digit finger weights + honest tear metrics
The exp05 verdict ("weights alone cannot clear the bar on this mesh") was
measured against a hard partition that was itself causing much of the tearing.
exp01-exp05 gave every vert to exactly ONE digit -- 08_finger_weights.py had an
explicit `elif lo in FING: continue # other digit: hard wall` -- which
guarantees the fused inter-digit bridges tear by the full finger separation,
because a single edge ring absorbs the whole gap.
Replace that with graded blending (WEB_BLEND_R0): a vert's fraction toward its
nearest other digit ramps 0 -> 0.5 as r = d_own/(d_own+d_other) goes 0.35 -> 0.5,
so both sides of the equidistance valley reach 50/50 and the field is continuous
across the boundary. Applied after the smoother (whose hard wall would erode beta
exactly where it must survive) and evaluated in the neighbour digit's own
arc-length frame. WEB_BLEND_SKIP excludes the thumb: its transform is opposition,
not curl, so its frame does not correspond to a finger's.
Measured against an identical baseline (same input, blend the only variable),
real tears (>=1mm rest length) drop 23-60% with NO regression on flat, the pose
that ships: fist_r 1178 -> 530, grip_r 561 -> 222, fist_l 979 -> 633,
grip_l 420 -> 322; total >5x 2487 -> 1307; p99.9 better on every pose;
flat unchanged at 0/1. fin_bones confirms the mechanism rather than just the
count -- the middle<->ring and pinky<->ring families leave the top classes while
the thumb/palm ones are untouched to the edge (182 -> 182, 148 -> 148).
This does NOT make fist/grip shippable: 222-633 real tears still reads as a
destroyed hand in clay renders, and the residual is now ~53% thumb-pad-fused-to
-palm, which is topology and needs mesh surgery or the v02 rebake. Flat and
relaxed are the shippable poses; fist/grip belong to the morph lane for now.
Also here:
- README: the solver's input is v02/..._exp03.glb, NOT exp01. exp01 is pre-hand
-fit (converter steps 2b/2c); its finger groups sit on the wrist and overlap
the real finger by 1.6cm, so a solve from it silently zeroes every _02/_03 bone
-- rigid stick fingers and a torn flat -- while weight sums stay 1.0 and every
assert passes. Cost three wasted bakes and one false "the solver regressed".
- Seed assert demanded >=100 seeds while the radius loop caps at
SEED_AXIS_R_MAX, which left pinky (88 seeds at 16mm) can never satisfy; the two
constants were mutually unsatisfiable. Now >=60, and it is documented as a
sanity gate rather than a quality bar.
- Detwist poses tested at last: real but marginal (fist_r 38.7x -> 28.7x,
grip_r 30.0x -> 17.3x, left hand flat). A knob, not a fix.
- edge_stretch_cmp.py / skin_bone_territory.py / handpose_trim_hand_obj.py:
judge tears by rest length and absolute posed growth, not raw ratio; audit
whether a bone owns any verts at all (thumb_01 owns ZERO in exp05); and trim
an arm-sized skin dump to the hand before rendering.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
"""Count connected components in a slab of an OBJ, to tell separated digits from a fused
|
||||
mitt. Slice just past the knuckles: 4 components = separate fingers, 1 = fused paddle.
|
||||
|
||||
usage: obj_slice_components.py mesh.obj AXIS LO HI (axis x|y|z, bounds in metres)
|
||||
"""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from collections import defaultdict, deque
|
||||
|
||||
path, axis, lo, hi = sys.argv[1], sys.argv[2], float(sys.argv[3]), float(sys.argv[4])
|
||||
ai = {"x": 0, "y": 1, "z": 2}[axis]
|
||||
|
||||
vs, faces = [], []
|
||||
for line in Path(path).read_text().splitlines():
|
||||
if line.startswith("v "):
|
||||
p = line.split()
|
||||
vs.append((float(p[1]), float(p[2]), float(p[3])))
|
||||
elif line.startswith("f "):
|
||||
faces.append([int(t.split("/")[0]) - 1 for t in line.split()[1:]])
|
||||
|
||||
inslab = [i for i, v in enumerate(vs) if lo <= v[ai] <= hi]
|
||||
sel = set(inslab)
|
||||
adj = defaultdict(set)
|
||||
kept = 0
|
||||
for f in faces:
|
||||
if all(k in sel for k in f):
|
||||
kept += 1
|
||||
for a in f:
|
||||
for b in f:
|
||||
if a != b:
|
||||
adj[a].add(b)
|
||||
|
||||
seen = set()
|
||||
comps = []
|
||||
for v in inslab:
|
||||
if v in seen:
|
||||
continue
|
||||
q = deque([v]); seen.add(v); c = []
|
||||
while q:
|
||||
u = q.popleft(); c.append(u)
|
||||
for w in adj.get(u, ()):
|
||||
if w not in seen:
|
||||
seen.add(w); q.append(w)
|
||||
comps.append(c)
|
||||
|
||||
comps.sort(key=len, reverse=True)
|
||||
print(f"{Path(path).name} slab {axis} in [{lo}, {hi}]")
|
||||
print(f" verts in slab {len(inslab)}, faces kept {kept}, components {len(comps)}")
|
||||
for n, c in enumerate(comps[:10]):
|
||||
if len(c) < 4:
|
||||
continue
|
||||
ext = [(min(vs[k][d] for k in c) * 100, max(vs[k][d] for k in c) * 100) for d in range(3)]
|
||||
span = [f"{e[1]-e[0]:.1f}" for e in ext]
|
||||
ctr = [f"{(e[0]+e[1])/2:.1f}" for e in ext]
|
||||
print(f" comp{n}: {len(c):5d} verts span(cm) x{span[0]} y{span[1]} z{span[2]}"
|
||||
f" centre({ctr[0]}, {ctr[1]}, {ctr[2]})")
|
||||
big = [c for c in comps if len(c) >= 20]
|
||||
print(f" components with >=20 verts: {len(big)}")
|
||||
Reference in New Issue
Block a user