55import numpy as np
66import pyvista as pv
77
8- from .loop_cgal import NumpyMesh , NumpyPlane , clip_plane , clip_surface , corefine_mesh
9- from .loop_cgal import TriMesh as _TriMesh
10-
8+ from ._loop_cgal import NumpyMesh , NumpyPlane , clip_plane , clip_surface , corefine_mesh
9+ from ._loop_cgal import TriMesh as _TriMesh
10+ from ._loop_cgal import verbose
11+ from ._loop_cgal import set_verbose as set_verbose
1112class TriMesh (_TriMesh ):
1213 """
1314 A class for handling triangular meshes using CGAL.
@@ -21,7 +22,7 @@ def __init__(self, surface: pv.PolyData):
2122
2223 def to_pyvista (self , area_threshold : float = 1e-6 , # this is the area threshold for the faces, if the area is smaller than this it will be removed
2324 duplicate_vertex_threshold : float = 1e-4 , # this is the threshold for duplicate vertices
24- verbose : bool = False ) -> pv .PolyData :
25+ ) -> pv .PolyData :
2526 """
2627 Convert the TriMesh to a pyvista PolyData object.
2728
@@ -30,7 +31,7 @@ def to_pyvista(self, area_threshold: float = 1e-6, # this is the area threshold
3031 pyvista.PolyData
3132 The converted PolyData object.
3233 """
33- np_mesh = self .save (area_threshold , duplicate_vertex_threshold , verbose )
34+ np_mesh = self .save (area_threshold , duplicate_vertex_threshold )
3435 vertices = np .array (np_mesh .vertices ).copy ()
3536 triangles = np .array (np_mesh .triangles ).copy ()
3637 return pv .PolyData .from_regular_faces (vertices , triangles )
@@ -47,7 +48,6 @@ def clip_pyvista_polydata_with_plane(
4748 area_threshold : float = 0.0001 ,
4849 protect_constraints : bool = False ,
4950 relax_constraints : bool = True ,
50- verbose : bool = False ,
5151) -> pv .PolyData :
5252 """
5353 Clip a pyvista PolyData object with a plane using the CGAL library.
@@ -72,8 +72,7 @@ def clip_pyvista_polydata_with_plane(
7272 The threshold for merging duplicate vertices, by default 0.001
7373 area_threshold : float, optional
7474 The area threshold for removing small faces, by default 0.0001
75- verbose : bool, optional
76- Whether to print verbose output, by default False
75+
7776 Returns
7877 -------
7978 pyvista.PolyData
@@ -98,7 +97,6 @@ def clip_pyvista_polydata_with_plane(
9897 area_threshold = area_threshold ,
9998 protect_constraints = protect_constraints ,
10099 relax_constraints = relax_constraints ,
101- verbose = verbose ,
102100 )
103101 return pv .PolyData .from_regular_faces (mesh .vertices , mesh .triangles )
104102
@@ -114,7 +112,6 @@ def clip_pyvista_polydata(
114112 area_threshold : float = 0.0001 ,
115113 protect_constraints : bool = False ,
116114 relax_constraints : bool = True ,
117- verbose : bool = False ,
118115) -> pv .PolyData :
119116 """
120117 Clip two pyvista PolyData objects using the CGAL library.
@@ -150,7 +147,6 @@ def clip_pyvista_polydata(
150147 area_threshold = area_threshold ,
151148 protect_constraints = protect_constraints ,
152149 relax_constraints = relax_constraints ,
153- verbose = verbose ,
154150 )
155151 return pv .PolyData .from_regular_faces (mesh .vertices , mesh .triangles )
156152
@@ -164,7 +160,6 @@ def corefine_pyvista_polydata(
164160 number_of_iterations : int = 10 ,
165161 protect_constraints : bool = True ,
166162 relax_constraints : bool = True ,
167- verbose : bool = False ,
168163) -> Tuple [pv .PolyData , pv .PolyData ]:
169164 """
170165 Corefine two pyvista PolyData objects using the CGAL library.
@@ -199,7 +194,6 @@ def corefine_pyvista_polydata(
199194 number_of_iterations = number_of_iterations ,
200195 relax_constraints = relax_constraints ,
201196 protect_constraints = protect_constraints ,
202- verbose = verbose ,
203197 )
204198 return (
205199 pv .PolyData .from_regular_faces (tm1 .vertices , tm1 .triangles ),
0 commit comments