Skip to content

Commit 40f84ae

Browse files
Update repair_tools.py
1 parent 6d3d9b7 commit 40f84ae

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,42 @@ def __init__(self, channel: grpc.Channel):
5454

5555
@protect_grpc
5656
def find_split_edges(self, **kwargs) -> dict: # noqa: D102
57+
"""Identify split edges in the geometry.
58+
59+
This method interacts with the gRPC service to identify split edges
60+
in the provided geometry based on the input parameters.
61+
62+
Parameters
63+
----------
64+
**kwargs : dict
65+
Keyword arguments containing the input parameters for the request.
66+
- bodies_or_faces: list
67+
List of body or face identifiers to inspect.
68+
- angle: float
69+
The angle threshold for identifying split edges.
70+
- distance: float
71+
The distance threshold for identifying split edges.
72+
73+
Returns
74+
-------
75+
dict
76+
A dictionary containing the identified split edge problems. Each problem
77+
includes an ID and a list of associated edge monikers.
78+
79+
Example:
80+
{
81+
"problems": [
82+
{
83+
"id": "problem_id_1",
84+
"edges": ["edge_1", "edge_2"]
85+
},
86+
...
87+
]
88+
}
89+
"""
5790
from ansys.api.geometry.v0.repairtools_pb2 import FindSplitEdgesRequest
5891

59-
# Create the request - assumes all inputs are valid and of the proper type
92+
# Create the gRPC request
6093
request = FindSplitEdgesRequest(
6194
bodies_or_faces=kwargs["bodies_or_faces"],
6295
angle=kwargs["angle"],
@@ -66,7 +99,7 @@ def find_split_edges(self, **kwargs) -> dict: # noqa: D102
6699
# Call the gRPC service
67100
response = self.stub.FindSplitEdges(request)
68101

69-
# Return the response - formatted as a dictionary
102+
# Format and return the response as a dictionary
70103
return {
71104
"problems": [
72105
{
@@ -258,14 +291,31 @@ def find_and_fix_simplify(self, **kwargs) -> dict: # noqa: D102
258291

259292
@protect_grpc
260293
def inspect_geometry(self, **kwargs) -> dict: # noqa: D102
294+
"""Inspect the geometry for issues.
295+
296+
Parameters
297+
----------
298+
**kwargs : dict
299+
Keyword arguments containing the input parameters for the inspection.
300+
- bodies: list
301+
List of bodies to inspect.
302+
303+
Returns
304+
-------
305+
dict
306+
A dictionary containing the serialized inspection results.
307+
"""
261308
from ansys.api.geometry.v0.repairtools_pb2 import InspectGeometryRequest
262309

310+
# Create the gRPC request
263311
request = InspectGeometryRequest(bodies=kwargs.get("bodies", []))
312+
264313
# Call the gRPC service
265314
inspect_result_response = self.stub.InspectGeometry(request)
266-
# Return the response - formatted as a dictionary
267315

316+
# Serialize and return the response
268317
return self.serialize_inspect_result_response(inspect_result_response)
318+
269319
@protect_grpc
270320
def repair_geometry(self, **kwargs) -> dict: # noqa: D102
271321
from ansys.api.geometry.v0.repairtools_pb2 import RepairGeometryRequest

0 commit comments

Comments
 (0)