"""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"]