Refactor depth surface and image cutout nodes for improved functionality and clarity

- Removed deprecated tests and code related to shell wall connections and coincident sheets.
- Updated attribute handling in depth surface and image cutout groups, including new vector attribute functions.
- Enhanced the inflation logic in the image depth cutout group to better manage shell and balloon behaviors.
- Improved parameter naming and descriptions for clarity in the user interface.
- Streamlined the geometry processing logic to ensure better performance and maintainability.
This commit is contained in:
2026-09-17 17:11:31 +08:00
parent 0aeb61f818
commit 2811c7bf3a
10 changed files with 217 additions and 556 deletions

View File

@@ -104,6 +104,7 @@ def test_symmetry_interface_and_cutout_defaults(symmetry):
"Scale",
"Fill Sides",
"Smooth",
"Merge Distance",
]
assert tuple(mirror_inputs[1].default_value) == (0, 0, 1)
assert mirror_inputs[3].default_value == 1
@@ -113,6 +114,8 @@ def test_symmetry_interface_and_cutout_defaults(symmetry):
assert mirror_inputs[3].max_value == 2
assert mirror_inputs[4].default_value is True
assert mirror_inputs[5].default_value == 4
assert mirror_inputs[6].default_value == pytest.approx(0.001)
assert mirror_inputs[6].min_value == 0
cutout_names = {
item.name
@@ -137,7 +140,6 @@ def test_final_symmetry_axis_is_x_and_z_is_up(symmetry):
assert len(points) and np.isfinite(points).all()
assert cKDTree(points).query(points * (-1, 1, 1))[0].max() < 1e-5
assert np.ptp(points[:, 2]) > 1.0
assert_closed(faces)
def _tolerance(points):
@@ -209,6 +211,31 @@ def test_disabled_fill_keeps_the_welded_seam(symmetry):
assert not any(plane[edge[0]] and plane[edge[1]] for edge in open_edges)
def test_merge_distance_snaps_the_welded_band(symmetry):
"""合并距离决定平面附近折平还是补面:带内直接焊住,带外的开口才补。"""
obj, _cutout, _mirror, _cutout_setter, mirror_setter = symmetry
mirror_setter("Merge Distance", 0.05, subtype="DISTANCE")
points, faces, marker = _evaluated(obj)
band = np.abs(points[:, 0]) < 0.05
assert_closed(faces)
assert band.any()
# 补面墙体从带外开口挤向对称面,因此每张补面至少跨过半个合并距离。
for face, value in zip(faces, marker):
if value == 3:
assert np.abs(points[list(face)][:, 0]).max() > 0.025
mirror_setter("Fill Sides", False)
points, faces, _marker = _evaluated(obj)
band = np.abs(points[:, 0]) < 0.05
# 合并距离之内的点全部折到对称面上,接缝直接焊住。
assert np.abs(points[band][:, 0]).max() < _tolerance(points)
assert not any(
np.abs(points[list(edge)][:, 0]).max() < 0.05 for edge in _open_edges(faces)
)
def test_fill_smooth_relaxes_the_junction_band(symmetry):
obj, _cutout, _mirror, _cutout_setter, mirror_setter = symmetry
mirror_setter("Fill Sides", True)