diff --git a/src/ansys/geometry/core/tools/repair_tools.py b/src/ansys/geometry/core/tools/repair_tools.py index 4e22bc474f..1fccc0fc84 100644 --- a/src/ansys/geometry/core/tools/repair_tools.py +++ b/src/ansys/geometry/core/tools/repair_tools.py @@ -459,7 +459,7 @@ def find_interferences( @protect_grpc @min_backend_version(25, 2, 0) def find_and_fix_short_edges( - self, bodies: list["Body"], length: Real = 0.0 + self, bodies: list["Body"], length: Real = 0.0, comprehensive_result: bool = False ) -> RepairToolMessage: """Find and fix the short edge problem areas. @@ -473,6 +473,9 @@ def find_and_fix_short_edges( List of bodies that short edges are investigated on. length : Real, optional The maximum length of the edges. By default, 0.0. + comprehensive_result : bool, optional + Determines whether the repair tool will attempt to fix all problem areas at once (false, default), or each individually (true). + Fixing each area individually may take longer, but gives a more comprehensive result about the repair operation's success. Returns ------- @@ -483,6 +486,7 @@ def find_and_fix_short_edges( check_type_all_elements_in_iterable(bodies, Body) check_type(length, Real) + check_type(comprehensive_result, bool) if not bodies: return RepairToolMessage(False, [], [], 0, 0) @@ -491,6 +495,7 @@ def find_and_fix_short_edges( FindShortEdgesRequest( selection=[body.id for body in bodies], max_edge_length=DoubleValue(value=length), + comprehensive=comprehensive_result ) ) @@ -507,7 +512,7 @@ def find_and_fix_short_edges( @protect_grpc @min_backend_version(25, 2, 0) - def find_and_fix_extra_edges(self, bodies: list["Body"]) -> RepairToolMessage: + def find_and_fix_extra_edges(self, bodies: list["Body"], comprehensive_result: bool = False) -> RepairToolMessage: """Find and fix the extra edge problem areas. Notes @@ -520,6 +525,9 @@ def find_and_fix_extra_edges(self, bodies: list["Body"]) -> RepairToolMessage: List of bodies that short edges are investigated on. length : Real The maximum length of the edges. + comprehensive_result : bool, optional + Determines whether the repair tool will attempt to fix all problem areas at once (false, default), or each individually (true). + Fixing each area individually may take longer, but gives a more comprehensive result about the repair operation's success. Returns ------- @@ -529,6 +537,7 @@ def find_and_fix_extra_edges(self, bodies: list["Body"]) -> RepairToolMessage: from ansys.geometry.core.designer.body import Body check_type_all_elements_in_iterable(bodies, Body) + check_type(comprehensive_result, bool) if not bodies: return RepairToolMessage(False, [], [], 0, 0) @@ -536,6 +545,7 @@ def find_and_fix_extra_edges(self, bodies: list["Body"]) -> RepairToolMessage: response = self._repair_stub.FindAndFixExtraEdges( FindExtraEdgesRequest( selection=[body.id for body in bodies], + comprehensive=comprehensive_result ) ) @@ -553,7 +563,7 @@ def find_and_fix_extra_edges(self, bodies: list["Body"]) -> RepairToolMessage: @protect_grpc @min_backend_version(25, 2, 0) def find_and_fix_split_edges( - self, bodies: list["Body"], angle: Real = 0.0, length: Real = 0.0 + self, bodies: list["Body"], angle: Real = 0.0, length: Real = 0.0, comprehensive_result: bool = False ) -> RepairToolMessage: """Find and fix the split edge problem areas. @@ -569,6 +579,10 @@ def find_and_fix_split_edges( The maximum angle between edges. By default, 0.0. length : Real, optional The maximum length of the edges. By default, 0.0. + comprehensive_result : bool, optional + Determines whether the repair tool will attempt to fix all problem areas at once (false, default), or each individually (true). + Fixing each area individually may take longer, but gives a more comprehensive result about the repair operation's success. + Returns ------- @@ -580,6 +594,7 @@ def find_and_fix_split_edges( check_type_all_elements_in_iterable(bodies, Body) check_type(angle, Real) check_type(length, Real) + check_type(comprehensive_result, bool) if not bodies: return RepairToolMessage(False, [], [], 0, 0) @@ -590,7 +605,7 @@ def find_and_fix_split_edges( response = self._repair_stub.FindAndFixSplitEdges( FindSplitEdgesRequest( - bodies_or_faces=body_ids, angle=angle_value, distance=length_value + bodies_or_faces=body_ids, angle=angle_value, distance=length_value, comprehensive=comprehensive_result ) )