ModelTranslator: extend seam angle sweep to 15deg for QR smooth meshes
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
6fe646310e
commit
c4c7ab0e23
@@ -280,7 +280,9 @@ UVPM_EXT = "bl_ext.user_default.uvpackmaster4" # UVPackmaster 4 扩展模块
|
||||
UVPM_PIXEL_MARGIN = 4 # UVPM 岛间距(像素),与 PACK_MARGIN * UVPM_TEX_SIZE 同口径
|
||||
UVPM_TEX_SIZE = 2048
|
||||
UVPM_ROTATION_STEP = 15 # UVPM 旋转步进(度);比默认 90 更细,利于薄斜条对齐(启发式因引擎崩溃已弃用)
|
||||
SEAM_ANGLE_SWEEP = (55.0, 45.0, 35.0) # 首选 SEAM_ANGLE_DEG 不过门时依次下探的 seam 角度
|
||||
SEAM_ANGLE_SWEEP = (55.0, 45.0, 35.0, 30.0, 25.0, 20.0, 15.0) # 首选 SEAM_ANGLE_DEG 不过门时依次下探的 seam 角度;
|
||||
# 下探到 15° 是为 QR 光滑四边网格——锐边少、高角度标不到 seam 会重叠爆炸回退 smart(拉糊),
|
||||
# 实测 guang 到 30° 才过门。早停取首个过门的最高角度=岛最少,对已在高角度过门的模型无影响。
|
||||
STRETCH_ITERS = 30 # minimize_stretch 松弛迭代次数
|
||||
REL_WELD = 1e-4 # 焊接距离占局部包围盒对角线比例(避免 cm/m 单位差异导致绝对阈值失准)
|
||||
|
||||
|
||||
@@ -151,5 +151,18 @@ class TestPickBestCandidate(unittest.TestCase):
|
||||
self.assertEqual(best["angle"], 55)
|
||||
|
||||
|
||||
class TestSeamAngleSweep(unittest.TestCase):
|
||||
def test_descending(self):
|
||||
s = list(bd.SEAM_ANGLE_SWEEP)
|
||||
self.assertEqual(s, sorted(s, reverse=True))
|
||||
|
||||
def test_reaches_low_angle(self):
|
||||
# 需下探到 <=30° 以覆盖 QR 光滑四边网格(实测 guang 30° 才过门)
|
||||
self.assertLessEqual(min(bd.SEAM_ANGLE_SWEEP), 30.0)
|
||||
|
||||
def test_below_first_angle(self):
|
||||
self.assertLess(max(bd.SEAM_ANGLE_SWEEP), bd.SEAM_ANGLE_DEG)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user