- 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.
22 lines
1.0 KiB
Python
22 lines
1.0 KiB
Python
"""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"]
|