2626geometry issues, such as split edges, extra edges, duplicate faces, and more.
2727"""
2828
29- from abc import ABC , abstractmethod
29+ from google . protobuf . wrappers_pb2 import BoolValue , DoubleValue
3030import grpc
31- from .. base . repair_tools import GRPCRepairToolsService
31+
3232from ansys .geometry .core .errors import protect_grpc
33- from google .protobuf .wrappers_pb2 import BoolValue , DoubleValue
3433
34+ from ..base .repair_tools import GRPCRepairToolsService
3535
3636
3737class GRPCRepairToolsServiceV0 (GRPCRepairToolsService ):
38-
3938 @protect_grpc
4039 def __init__ (self , channel : grpc .Channel ):
4140 from ansys .api .geometry .v0 .repairtools_pb2_grpc import RepairToolsStub
@@ -44,9 +43,8 @@ def __init__(self, channel: grpc.Channel):
4443
4544 @protect_grpc
4645 def find_split_edges (self , ** kwargs ):
47-
4846 from ansys .api .geometry .v0 .repairtools_pb2 import FindSplitEdgesRequest
49-
47+
5048 request = FindSplitEdgesRequest (
5149 bodies_or_faces = kwargs ["bodies_or_faces" ],
5250 angle = kwargs ["angle" ],
@@ -57,86 +55,101 @@ def find_split_edges(self, **kwargs):
5755 @protect_grpc
5856 def find_extra_edges (self , ** kwargs ):
5957 from ansys .api .geometry .v0 .repairtools_pb2 import FindExtraEdgesRequest
58+
6059 request = FindExtraEdgesRequest (selection = kwargs ["selection" ])
6160 return self .stub .FindExtraEdges (request )
6261
6362 @protect_grpc
6463 def find_inexact_edges (self , ** kwargs ):
6564 from ansys .api .geometry .v0 .repairtools_pb2 import FindInexactEdgesRequest
65+
6666 request = FindInexactEdgesRequest (selection = kwargs ["selection" ])
67- return self .stub .FindInexactEdges (request )
68-
69-
67+ return self .stub .FindInexactEdges (request )
68+
7069 @protect_grpc
7170 def find_short_edges (self , ** kwargs ):
7271 from ansys .api .geometry .v0 .repairtools_pb2 import FindShortEdgesRequest
72+
7373 request = FindShortEdgesRequest (
7474 selection = kwargs ["selection" ],
7575 max_edge_length = DoubleValue (value = kwargs ["length" ]),
7676 )
7777 return self .stub .FindShortEdges (request )
78-
78+
7979 @protect_grpc
8080 def find_duplicate_faces (self , ** kwargs ):
8181 from ansys .api .geometry .v0 .repairtools_pb2 import FindDuplicateFacesRequest
82+
8283 request = FindDuplicateFacesRequest (faces = kwargs ["faces" ])
8384 return self .stub .FindDuplicateFaces (request )
8485
85-
8686 @protect_grpc
8787 def find_missing_faces (self , ** kwargs ):
8888 from ansys .api .geometry .v0 .repairtools_pb2 import FindMissingFacesRequest
89+
8990 request = FindMissingFacesRequest (faces = kwargs ["faces" ])
90- return self .stub .FindMissingFaces (request )
91+ return self .stub .FindMissingFaces (request )
9192
9293 @protect_grpc
9394 def find_small_faces (self , ** kwargs ):
9495 from ansys .api .geometry .v0 .repairtools_pb2 import FindSmallFacesRequest
96+
9597 request = FindSmallFacesRequest (selection = kwargs ["selection" ])
9698 return self .stub .FindSmallFaces (request )
97-
99+
98100 @protect_grpc
99101 def find_stitch_faces (self , ** kwargs ):
100102 from ansys .api .geometry .v0 .repairtools_pb2 import FindStitchFacesRequest
103+
101104 request = FindStitchFacesRequest (faces = kwargs ["faces" ])
102105 return self .stub .FindStitchFaces (request )
103-
106+
104107 @protect_grpc
105108 def find_simplify (self , ** kwargs ):
106109 from ansys .api .geometry .v0 .repairtools_pb2 import FindAdjustSimplifyRequest
110+
107111 request = FindAdjustSimplifyRequest (selection = kwargs ["selection" ])
108112 return self .stub .FindAdjustSimplify (request )
109-
113+
110114 @protect_grpc
111115 def find_and_fix_simplify (self , ** kwargs ):
112116 from ansys .api .geometry .v0 .repairtools_pb2 import FindAdjustSimplifyRequest
117+
113118 request = FindAdjustSimplifyRequest (
114119 selection = kwargs ["selection" ],
115120 comprehensive = kwargs ["comprehensive_result" ],
116121 )
117- return self .stub .FindAndSimplify (request )
118-
122+ return self .stub .FindAndSimplify (request )
123+
119124 @protect_grpc
120125 def inspect_geometry (self , ** kwargs ):
121126 from ansys .api .geometry .v0 .repairtools_pb2 import InspectGeometryRequest
127+
122128 request = InspectGeometryRequest (bodies = kwargs .get ("bodies" , []))
123129 return self .stub .InspectGeometry (request )
124-
130+
125131 @protect_grpc
126132 def repair_geometry (self , ** kwargs ):
127133 from ansys .api .geometry .v0 .repairtools_pb2 import RepairGeometryRequest
134+
128135 request = RepairGeometryRequest (bodies = kwargs .get ("bodies" , []))
129136 return self .stub .RepairGeometry (request )
130-
137+
131138 @protect_grpc
132139 def find_interferences (self , ** kwargs ):
133140 from ansys .api .geometry .v0 .repairtools_pb2 import FindInterferenceRequest
141+
134142 request = FindInterferenceRequest (
135143 bodies = kwargs ["bodies" ],
136144 cut_smaller_body = BoolValue (value = kwargs ["cut_smaller_body" ]),
137145 )
138- return self .stub .FindInterference (request )
146+ return self .stub .FindInterference (request )
147+
148+ def find_and_fix_short_edges (self , ** kwargs ):
149+ raise NotImplementedError
150+
151+ def find_and_fix_extra_edges (self , ** kwargs ):
152+ raise NotImplementedError
139153
140- def find_and_fix_short_edges (self , ** kwargs ): raise NotImplementedError
141- def find_and_fix_extra_edges (self , ** kwargs ): raise NotImplementedError
142- def find_and_fix_split_edges (self , ** kwargs ): raise NotImplementedError
154+ def find_and_fix_split_edges (self , ** kwargs ):
155+ raise NotImplementedError
0 commit comments