refactor: Update cutout and depth handling by removing unused functions and adjusting parameters

This commit is contained in:
2026-09-13 22:08:32 +08:00
parent a0dd6e4a88
commit 1bf858b17e
13 changed files with 88 additions and 326 deletions

View File

@@ -62,7 +62,7 @@ def test_smoothing_reduces_stairs_without_leaving_two_ring_band(triangles):
band = edge_band(faces, boundary)
movable = np.array([i in band for i in range(len(original))])
assert movable.any() and (~movable).any()
set_value("Boundary Smooth", 20)
set_value("Boundary Smooth", 16)
smoothed, result_faces = evaluated(obj)
assert result_faces == faces
np.testing.assert_array_equal(smoothed[~movable], original[~movable])
@@ -85,11 +85,11 @@ def test_smoothing_reduces_stairs_without_leaving_two_ring_band(triangles):
np.testing.assert_array_equal(evaluated(obj)[0], original)
def test_smoothing_without_split_moves_original_boundary_only_within_band():
def test_smoothing_without_split_moves_outline_only_within_boundary_band():
obj, set_value = diagonal_surface()
set_value("Depth Split", 0)
original, faces = evaluated(obj)
set_value("Boundary Smooth", 20)
set_value("Boundary Smooth", 16)
result, result_faces = evaluated(obj)
boundary = boundary_neighbors(faces)
band = edge_band(faces, boundary)
@@ -97,6 +97,8 @@ def test_smoothing_without_split_moves_original_boundary_only_within_band():
assert np.max(np.linalg.norm(result[list(boundary)] - original[list(boundary)], axis=1)) > 1e-4
np.testing.assert_array_equal(result[outside], original[outside])
assert result_faces == faces
set_value("Boundary Smooth", 0)
np.testing.assert_array_equal(evaluated(obj)[0], original)
@pytest.mark.parametrize("mode", [0, 1])
@@ -147,7 +149,7 @@ def test_plane_edge_smoothing_preserves_uvs_and_closes_thickness():
from tests.support.planes import create_surface, evaluated as plane_mesh
obj, set_value, _, inputs, image = create_surface("DEPTH")
assert inputs["Boundary Smooth"].default_value == 2
assert inputs["Boundary Smooth"].default_value == 4
assert inputs["Boundary Smooth"].parent.name == "Options"
pixels = np.array(image.pixels[:], np.float32).reshape(8, 16, 4)
yy, xx = np.mgrid[:8, :16]