Refactor depth node groups and simplify options

- Removed `Smooth Weight` input from `O Image Depth Plane`, `O Image Depth Cutout`, and `O Image Depth Panorama` to streamline the interface and maintain consistent boundary smoothing behavior.
- Adjusted the `Reference Depth` input to appear last in the options panel for better organization, reflecting its role as a calibration value.
- Consolidated the `expand_smooth()` function to only accept necessary parameters, eliminating unused branches related to `Smooth Weight` and `pin_sharp`.
- Updated related tests and node assets to ensure functionality remains intact and consistent with the new structure.
- Introduced new specifications to document the changes and ensure compliance with the updated requirements.
This commit is contained in:
2026-09-16 13:12:12 +08:00
parent 6ca084ee4a
commit 7f69630371
26 changed files with 741 additions and 178 deletions

View File

@@ -91,6 +91,30 @@ def assert_closed(faces):
assert edges and set(edges.values()) == {2}, Counter(edges.values())
def assert_single_vertex_fans(faces):
"""Every vertex must close one face fan so touching sheets stay identifiable."""
incident = {}
for index, face in enumerate(faces):
for start, end in zip(face, (*face[1:], face[0])):
edge = tuple(sorted((start, end)))
incident.setdefault(start, {}).setdefault(edge, []).append(index)
incident.setdefault(end, {}).setdefault(edge, []).append(index)
for vertex, edges in incident.items():
shared = {}
for faces_at_edge in edges.values():
assert len(faces_at_edge) == 2, (vertex, faces_at_edge)
first, second = faces_at_edge
shared.setdefault(first, set()).add(second)
shared.setdefault(second, set()).add(first)
assert all(len(neighbors) == 2 for neighbors in shared.values()), vertex
reached, pending = {next(iter(shared))}, [next(iter(shared))]
while pending:
for neighbor in shared[pending.pop()] - reached:
reached.add(neighbor)
pending.append(neighbor)
assert len(reached) == len(shared), vertex
def component_count(faces):
adjacency = {}
for face in faces: