Skip to content

Commit 4e35ac9

Browse files
committed
ignoring some warning when mesh.extract_surface
1 parent 6bedf8f commit 4e35ac9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

api/pyvista_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from g4_units import convert_list
22
import numpy as np
3+
import warnings
34

45

56
def euler_matrix_zyx(deg_rx, deg_ry, deg_rz):
@@ -259,7 +260,9 @@ def configure_actor_lighting(actor, metallic=False):
259260
def cloud_points_from_surface(pv, mesh, n_points=8000):
260261
"""Create a deterministic PyVista point cloud sampled from a mesh surface."""
261262
try:
262-
surface = mesh.extract_surface(algorithm="dataset_surface").triangulate()
263+
with warnings.catch_warnings():
264+
warnings.simplefilter("ignore")
265+
surface = mesh.extract_surface(algorithm="dataset_surface").triangulate()
263266
except Exception:
264267
return mesh
265268

0 commit comments

Comments
 (0)