Skip to content

Commit 517db56

Browse files
adding dict return typehint
removing offset_face_curves
1 parent 10b7493 commit 517db56

File tree

5 files changed

+7
-59
lines changed

5 files changed

+7
-59
lines changed

src/ansys/geometry/core/_grpc/_services/base/curves.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ def __init__(self, channel: grpc.Channel):
4040
pass
4141

4242
@abstractmethod
43-
def offset_face_curves(self, **kwargs) -> dict:
44-
"""Offset face curves."""
43+
def revolve_edges(self, **kwargs) -> dict:
44+
"""Revolve edges around an axis to create a surface of revolution."""
4545
pass

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

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,7 @@ def __init__(self, channel: grpc.Channel): # noqa: D102
5050
self.stub = CommandsStub(channel)
5151

5252
@protect_grpc
53-
def offset_face_curves(self, **kwargs): # noqa: D102
54-
from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier
55-
from ansys.api.geometry.v0.commands_pb2 import OffsetFaceCurvesRequest
56-
57-
# Create the request - assumes all inputs are valid and of the proper type
58-
request = OffsetFaceCurvesRequest(
59-
objects=[EntityIdentifier(id=id) for id in kwargs["curve_ids"]],
60-
offset=from_measurement_to_server_length(kwargs["offset"]),
61-
)
62-
63-
# Call the gRPC service
64-
result = self.stub.OffsetFaceCurves(request)
65-
66-
# Return the result - formatted as a dictionary
67-
return {
68-
"success": result.result.success,
69-
"created_curves": [curve.id for curve in result.created_curves]
70-
}
71-
72-
@protect_grpc
73-
def revolve_edges(self, **kwargs): # noqa: D102
53+
def revolve_edges(self, **kwargs) -> dict: # noqa: D102
7454
from ansys.api.geometry.v0.commands_pb2 import RevolveCurvesRequest
7555

7656
# Create the request - assumes all inputs are valid and of the proper type

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def create_iso_parametric_curve(self, **kwargs) -> dict: # noqa: D102
281281
}
282282

283283
@protect_grpc
284-
def extrude_faces(self, **kwargs): # noqa: D102
284+
def extrude_faces(self, **kwargs) -> dict: # noqa: D102
285285
from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier
286286
from ansys.api.geometry.v0.commands_pb2 import ExtrudeFacesRequest
287287

@@ -314,7 +314,7 @@ def extrude_faces(self, **kwargs): # noqa: D102
314314
}
315315

316316
@protect_grpc
317-
def extrude_faces_up_to(self, **kwargs): # noqa: D102
317+
def extrude_faces_up_to(self, **kwargs) -> dict: # noqa: D102
318318
from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier
319319
from ansys.api.geometry.v0.commands_pb2 import ExtrudeFacesUpToRequest
320320

@@ -503,7 +503,7 @@ def draft_faces(self, **kwargs) -> dict: # noqa: D102
503503
}
504504

505505
@protect_grpc
506-
def get_round_info(self, **kwargs): # noqa: D102
506+
def get_round_info(self, **kwargs) -> dict: # noqa: D102
507507
from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier
508508
from ansys.api.geometry.v0.commands_pb2 import RoundInfoRequest
509509

src/ansys/geometry/core/_grpc/_services/v1/curves.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ def __init__(self, channel: grpc.Channel): # noqa: D102
4646
from ansys.api.geometry.v1.curves_pb2_grpc import CurvesStub
4747

4848
self.stub = CurvesStub(channel)
49-
50-
@protect_grpc
51-
def offset_face_curves(self, **kwargs): # noqa: D102
52-
raise NotImplementedError
5349

5450
@protect_grpc
55-
def revolve_edges(self, **kwargs): # noqa: D102
51+
def revolve_edges(self, **kwargs) -> dict: # noqa: D102
5652
raise NotImplementedError

src/ansys/geometry/core/designer/geometry_commands.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,34 +1794,6 @@ def offset_faces(
17941794
extrude_type=extrude_type,
17951795
)
17961796

1797-
@min_backend_version(25, 2, 0)
1798-
def offset_face_curves(
1799-
self,
1800-
curves: Union["Curve", list["Curve"]],
1801-
offset: Distance | Quantity | Real,
1802-
) -> bool:
1803-
"""Offsets a given set of face curves by the specified distance.
1804-
1805-
Parameters
1806-
----------
1807-
curves : Curve | list[Curve]
1808-
The curves to offset.
1809-
offset : Distance | Quantity | Real
1810-
The distance to offset the curves.
1811-
1812-
Returns
1813-
-------
1814-
bool
1815-
``True`` when successful, ``False`` when failed.
1816-
"""
1817-
curves = curves if isinstance(curves, list) else [curves]
1818-
offset = offset if isinstance(offset, Distance) else Distance(offset)
1819-
1820-
_ = self._grpc_client._services.curves.offset_face_curves(
1821-
curves=[curve.id for curve in curves], # TODO
1822-
offset=offset
1823-
)
1824-
18251797
@min_backend_version(25, 2, 0)
18261798
def revolve_edges(
18271799
self,

0 commit comments

Comments
 (0)