2626from ansys .geometry .core .errors import protect_grpc
2727
2828from ..base .curves import GRPCCurvesService
29+ from .conversions import (
30+ from_angle_to_grpc_quantity ,
31+ from_grpc_point_to_point3d ,
32+ from_line_to_grpc_line ,
33+ from_trimmed_curve_to_grpc_trimmed_curve ,
34+ )
2935
3036
3137class GRPCCurvesServiceV1 (GRPCCurvesService ): # pragma: no cover
@@ -43,14 +49,60 @@ class GRPCCurvesServiceV1(GRPCCurvesService): # pragma: no cover
4349
4450 @protect_grpc
4551 def __init__ (self , channel : grpc .Channel ): # noqa: D102
46- from ansys .api .geometry .v1 .curves_pb2_grpc import CurvesStub
52+ from ansys .api .discovery .v1 .operations . edit_pb2_grpc import EditStub
4753
48- self .stub = CurvesStub (channel )
54+ self .stub = EditStub (channel )
4955
5056 @protect_grpc
5157 def revolve_edges (self , ** kwargs ) -> dict : # noqa: D102
52- raise NotImplementedError
58+ from ansys .api .discovery .v1 .operations .edit_pb2 import (
59+ RevolveCurvesRequest ,
60+ RevolveCurvesRequestData ,
61+ )
62+
63+ # Create the request - assumes all inputs are valid and of the proper type
64+ request = RevolveCurvesRequest (
65+ request_data = [
66+ RevolveCurvesRequestData (
67+ curves = [
68+ from_trimmed_curve_to_grpc_trimmed_curve (curve )
69+ for curve in kwargs ["curves" ]
70+ ],
71+ axis = from_line_to_grpc_line (kwargs ["axis" ]),
72+ angle = from_angle_to_grpc_quantity (kwargs ["angle" ]),
73+ symmetric = kwargs ["symmetric" ],
74+ )
75+ ]
76+ )
77+
78+ # Call the gRPC service
79+ _ = self .stub .RevolveCurves (request )
80+
81+ # Return the result - formatted as a dictionary
82+ return {}
5383
5484 @protect_grpc
5585 def intersect_curves (self , ** kwargs ) -> dict : # noqa: D102
56- raise NotImplementedError
86+ from ansys .api .discovery .v1 .operations .edit_pb2 import (
87+ IntersectCurvesRequest ,
88+ IntersectCurvesRequestData ,
89+ )
90+
91+ # Create the request - assumes all inputs are valid and of the proper type
92+ request = IntersectCurvesRequest (
93+ request_data = [
94+ IntersectCurvesRequestData (
95+ first = from_trimmed_curve_to_grpc_trimmed_curve (kwargs ["first" ]),
96+ second = from_trimmed_curve_to_grpc_trimmed_curve (kwargs ["second" ]),
97+ )
98+ ]
99+ )
100+
101+ # Call the gRPC service
102+ response = self .stub .IntersectCurves (request ).response_data [0 ]
103+
104+ # Return the result - formatted as a dictionary
105+ return {
106+ "intersect" : response .intersect ,
107+ "points" : [from_grpc_point_to_point3d (point ) for point in response .points ],
108+ }
0 commit comments