ModelTranslator: UV 质量门拆分并校准——翻转 2% / 重叠 8%(well1500 seam 不再误回退)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
88424f24e0
commit
0ba883b8d0
@@ -24,7 +24,8 @@ def within_tolerance(target, actual, tol=TOLERANCE):
|
||||
return abs(actual - target) <= target * tol
|
||||
|
||||
|
||||
UV_BAD_TOL = 0.02 # 质量门:UV 翻转/重叠面占比超此值则回退 smart_project
|
||||
UV_FLIP_TOL = 0.02 # 质量门:UV 翻转面占比超此值回退 smart_project
|
||||
UV_OVERLAP_TOL = 0.08 # 质量门:UV 重叠面占比阈值(手工 UV 同口径约 5%,灾难性失败 >20%)
|
||||
|
||||
|
||||
def count_islands(n_faces, adjacent_pairs):
|
||||
@@ -199,7 +200,7 @@ def _do_unwrap(obj, mode, warnings):
|
||||
_unwrap_seam(obj, warnings)
|
||||
m = _collect_uv_metrics(obj)
|
||||
overlap = m["overlap"] or 0.0
|
||||
if m["flipped"] <= UV_BAD_TOL and overlap <= UV_BAD_TOL:
|
||||
if m["flipped"] <= UV_FLIP_TOL and overlap <= UV_OVERLAP_TOL:
|
||||
m["mode"] = "seam"
|
||||
return m
|
||||
warnings.append("seam 展开质量不达标(翻转 %.1f%% 重叠 %s),回退 smart_project"
|
||||
|
||||
Reference in New Issue
Block a user