Add tests and implement boundary smoothing and cutout functionality

- Introduced tests for boundary smoothing in `test_boundary_smoothing.py`, verifying that smoothing reduces stair-step artifacts while preserving boundary integrity.
- Added tests for cutout boundary behavior in `test_cutout_boundary.py`, ensuring proper handling of boundary triangles and normal blending.
- Created `test_temporary_attributes.py` to check the cleanup of temporary attributes across depth modifier branches, ensuring no warnings are raised.
- Implemented point culling functionality in `test_validity.py`, confirming that invalid points are removed without affecting adjacent geometry.
- Developed boundary smoothing logic in `boundary_smoothing.py`, allowing for depth smoothing while maintaining edge integrity.
- Added cutout boundary management in `cutout_boundary.py`, including functions for removing boundary triangles and tapering thickness profiles.
- Implemented validity checks in `validity.py` to ensure proper deletion of invalid vertices and associated wire edges.
This commit is contained in:
2026-09-11 20:37:20 +08:00
parent e8129fe495
commit 31074bd511
85 changed files with 2501 additions and 1451 deletions

View File

@@ -0,0 +1,21 @@
"""Remove invalid vertices and the wire edges left by point deletion."""
def delete_invalid_points(group, geometry, invalid):
nodes, links = group.nodes, group.links
delete = nodes.new("GeometryNodeDeleteGeometry")
delete.domain, delete.mode = "POINT", "ALL"
links.new(geometry, delete.inputs["Geometry"])
links.new(invalid, delete.inputs["Selection"])
neighbors = nodes.new("GeometryNodeInputMeshEdgeNeighbors")
wire = nodes.new("FunctionNodeCompare")
wire.data_type, wire.operation = "INT", "EQUAL"
a = next(socket for socket in wire.inputs if socket.identifier == "A_INT")
b = next(socket for socket in wire.inputs if socket.identifier == "B_INT")
b.default_value = 0
links.new(neighbors.outputs["Face Count"], a)
cleanup = nodes.new("GeometryNodeDeleteGeometry")
cleanup.domain, cleanup.mode = "EDGE", "ALL"
links.new(delete.outputs["Geometry"], cleanup.inputs["Geometry"])
links.new(wire.outputs["Result"], cleanup.inputs["Selection"])
return cleanup.outputs["Geometry"]