[find_faces] handle empty poly
This commit is contained in:
parent
f4762733a6
commit
35bced6e55
1 changed files with 2 additions and 0 deletions
|
|
@ -106,6 +106,8 @@ def find_faces(neighbors: NDArray[numpy.integer]) -> list[NDArray[numpy.intp]]:
|
||||||
face, starting with the lowest index in the face.
|
face, starting with the lowest index in the face.
|
||||||
"""
|
"""
|
||||||
num_verts = neighbors.shape[0]
|
num_verts = neighbors.shape[0]
|
||||||
|
if num_verts == 0:
|
||||||
|
return []
|
||||||
|
|
||||||
edge_id = numpy.arange(3 * num_verts)
|
edge_id = numpy.arange(3 * num_verts)
|
||||||
v_start, nxt_edge = numpy.divmod(edge_id, 3) # arange % 3 is faster than tile
|
v_start, nxt_edge = numpy.divmod(edge_id, 3) # arange % 3 is faster than tile
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue