File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
src/ansys/geometry/core/_grpc/_services Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -93,3 +93,8 @@ def upload_file(self, **kwargs) -> dict:
9393 def upload_file_stream (self , ** kwargs ) -> dict :
9494 """Upload a file to the server using streaming."""
9595 pass
96+
97+ @abstractmethod
98+ def stream_design_tessellation (self , ** kwargs ) -> dict :
99+ """Stream the tessellation of a design."""
100+ pass
Original file line number Diff line number Diff line change @@ -256,3 +256,32 @@ def request_generator(
256256
257257 # Return the response - formatted as a dictionary
258258 return {"file_path" : response .file_path }
259+
260+ @protect_grpc
261+ def stream_design_tessellation (self , ** kwargs ) -> dict : # noqa: D102
262+ from ansys .api .dbu .v0 .designs_pb2 import DesignTessellationRequest
263+
264+ # Create the request - assumes all inputs are valid and of the proper type
265+ request = DesignTessellationRequest (
266+ chordal_deviation = kwargs ["chordal_deviation" ],
267+ angle_deviation = kwargs ["angle_deviation" ],
268+ max_aspect_ratio = kwargs ["max_aspect_ratio" ],
269+ min_edge_length = kwargs ["min_edge_length" ],
270+ max_edge_length = kwargs ["max_edge_length" ],
271+ deflection_type = kwargs ["deflection_type" ],
272+ )
273+
274+ # Call the gRPC service
275+ response = self .designs_stub .StreamDesignTessellation (request )
276+
277+ # Return the response - formatted as a dictionary
278+ points = []
279+ triangles = []
280+ for elem in response :
281+ points .extend (elem .points )
282+ triangles .extend (elem .triangles )
283+
284+ return {
285+ "points" : points ,
286+ "triangles" : triangles ,
287+ }
Original file line number Diff line number Diff line change @@ -90,3 +90,7 @@ def upload_file(self, **kwargs) -> dict: # noqa: D102
9090 @protect_grpc
9191 def upload_file_stream (self , ** kwargs ) -> dict : # noqa: D102
9292 raise NotImplementedError
93+
94+ @protect_grpc
95+ def stream_design_tessellation (self , ** kwargs ) -> dict : # noqa: D102
96+ raise NotImplementedError
You can’t perform that action at this time.
0 commit comments