Skip to content

Commit 9e8e1be

Browse files
jacobrkerstetterpyansys-ci-botRobPasMue
authored
fix: empty tessellation data conversion (#2284)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Roberto Pastor Muela <[email protected]>
1 parent 782aa66 commit 9e8e1be

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/changelog.d/2284.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Empty tessellation data conversion

src/ansys/geometry/core/_grpc/_services/v0/conversions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ def from_grpc_tess_to_pd(tess: GRPCTessellation) -> "pv.PolyData":
369369
import numpy as np
370370
import pyvista as pv
371371

372+
if len(tess.faces) == 0 or len(tess.vertices) == 0:
373+
return pv.PolyData()
374+
372375
return pv.PolyData(var_inp=np.array(tess.vertices).reshape(-1, 3), faces=tess.faces)
373376

374377

0 commit comments

Comments
 (0)