1- from .loop_cgal import clip_surface , NumpyMesh , NumpyPlane , clip_plane , corefine_mesh
2- from .loop_cgal import TriMesh as _TriMesh
3- import pyvista as pv
4- import numpy as np
1+ from __future__ import annotations
2+
53from typing import Tuple
64
5+ import numpy as np
6+ import pyvista as pv
7+
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
712class TriMesh (_TriMesh ):
813 """
914 A class for handling triangular meshes using CGAL.
@@ -17,7 +22,7 @@ def __init__(self, surface: pv.PolyData):
1722
1823 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
1924 duplicate_vertex_threshold : float = 1e-4 , # this is the threshold for duplicate vertices
20- verbose : bool = False ) -> pv .PolyData :
25+ ) -> pv .PolyData :
2126 """
2227 Convert the TriMesh to a pyvista PolyData object.
2328
@@ -26,7 +31,7 @@ def to_pyvista(self, area_threshold: float = 1e-6, # this is the area threshold
2631 pyvista.PolyData
2732 The converted PolyData object.
2833 """
29- np_mesh = self .save (area_threshold , duplicate_vertex_threshold , verbose )
34+ np_mesh = self .save (area_threshold , duplicate_vertex_threshold )
3035 vertices = np .array (np_mesh .vertices ).copy ()
3136 triangles = np .array (np_mesh .triangles ).copy ()
3237 return pv .PolyData .from_regular_faces (vertices , triangles )
@@ -43,7 +48,6 @@ def clip_pyvista_polydata_with_plane(
4348 area_threshold : float = 0.0001 ,
4449 protect_constraints : bool = False ,
4550 relax_constraints : bool = True ,
46- verbose : bool = False ,
4751) -> pv .PolyData :
4852 """
4953 Clip a pyvista PolyData object with a plane using the CGAL library.
@@ -68,8 +72,7 @@ def clip_pyvista_polydata_with_plane(
6872 The threshold for merging duplicate vertices, by default 0.001
6973 area_threshold : float, optional
7074 The area threshold for removing small faces, by default 0.0001
71- verbose : bool, optional
72- Whether to print verbose output, by default False
75+
7376 Returns
7477 -------
7578 pyvista.PolyData
@@ -94,7 +97,6 @@ def clip_pyvista_polydata_with_plane(
9497 area_threshold = area_threshold ,
9598 protect_constraints = protect_constraints ,
9699 relax_constraints = relax_constraints ,
97- verbose = verbose ,
98100 )
99101 return pv .PolyData .from_regular_faces (mesh .vertices , mesh .triangles )
100102
@@ -110,7 +112,6 @@ def clip_pyvista_polydata(
110112 area_threshold : float = 0.0001 ,
111113 protect_constraints : bool = False ,
112114 relax_constraints : bool = True ,
113- verbose : bool = False ,
114115) -> pv .PolyData :
115116 """
116117 Clip two pyvista PolyData objects using the CGAL library.
@@ -146,11 +147,8 @@ def clip_pyvista_polydata(
146147 area_threshold = area_threshold ,
147148 protect_constraints = protect_constraints ,
148149 relax_constraints = relax_constraints ,
149- verbose = verbose ,
150150 )
151- out = pv .PolyData .from_regular_faces (mesh .vertices , mesh .triangles )
152-
153- return out
151+ return pv .PolyData .from_regular_faces (mesh .vertices , mesh .triangles )
154152
155153
156154def corefine_pyvista_polydata (
@@ -162,7 +160,6 @@ def corefine_pyvista_polydata(
162160 number_of_iterations : int = 10 ,
163161 protect_constraints : bool = True ,
164162 relax_constraints : bool = True ,
165- verbose : bool = False ,
166163) -> Tuple [pv .PolyData , pv .PolyData ]:
167164 """
168165 Corefine two pyvista PolyData objects using the CGAL library.
@@ -197,7 +194,6 @@ def corefine_pyvista_polydata(
197194 number_of_iterations = number_of_iterations ,
198195 relax_constraints = relax_constraints ,
199196 protect_constraints = protect_constraints ,
200- verbose = verbose ,
201197 )
202198 return (
203199 pv .PolyData .from_regular_faces (tm1 .vertices , tm1 .triangles ),
0 commit comments