ModelTranslator: 新增 pick_best_candidate——过门且岛数最少者择优
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f0046ea64d
commit
788122b271
@@ -38,6 +38,16 @@ def uvpm_mode_label(base, applied):
|
||||
return base + "+uvpm" if applied else base
|
||||
|
||||
|
||||
def pick_best_candidate(candidates):
|
||||
"""从候选 UV 指标 dict 列表选过质量门且岛数最少者;无过门候选返回 None。
|
||||
每个 candidate 至少含 flipped/overlap/islands。"""
|
||||
passing = [c for c in candidates
|
||||
if uv_gate_ok(c["flipped"], c["overlap"])]
|
||||
if not passing:
|
||||
return None
|
||||
return min(passing, key=lambda c: c["islands"])
|
||||
|
||||
|
||||
def count_islands(n_faces, adjacent_pairs):
|
||||
"""union-find 数 UV 岛:n_faces 个面,adjacent_pairs 为 UV 连续的面索引对。"""
|
||||
parent = list(range(n_faces))
|
||||
|
||||
Reference in New Issue
Block a user