@@ -905,3 +905,185 @@ def combine_merge(self, **kwargs) -> dict: # noqa: D102
905905
906906 # Return the response - formatted as a dictionary
907907 return {}
908+
909+ @protect_grpc
910+ def assign_midsurface_thickness (self , ** kwargs ) -> dict : # noqa: D102
911+ from ansys .api .geometry .v0 .commands_pb2 import AssignMidSurfaceThicknessRequest
912+
913+ # Create the request - assumes all inputs are valid and of the proper type
914+ request = AssignMidSurfaceThicknessRequest (
915+ bodies_or_faces = kwargs ["ids" ],
916+ thickness = from_measurement_to_server_length (kwargs ["thickness" ]),
917+ )
918+
919+ # Call the gRPC service
920+ self .command_stub .AssignMidSurfaceThickness (request = request )
921+
922+ # Return the response - formatted as a dictionary
923+ return {}
924+
925+ @protect_grpc
926+ def assign_midsurface_offset (self , ** kwargs ) -> dict : # noqa: D102
927+ from ansys .api .geometry .v0 .commands_pb2 import AssignMidSurfaceOffsetTypeRequest
928+
929+ # Create the request - assumes all inputs are valid and of the proper type
930+ request = AssignMidSurfaceOffsetTypeRequest (
931+ bodies_or_faces = kwargs ["ids" ],
932+ offset_type = kwargs ["offset_type" ].value ,
933+ )
934+
935+ # Call the gRPC service
936+ self .command_stub .AssignMidSurfaceOffsetType (request = request )
937+
938+ # Return the response - formatted as a dictionary
939+ return {}
940+
941+ @protect_grpc
942+ def shell (self , ** kwargs ) -> dict : # noqa: D102
943+ from ansys .api .geometry .v0 .commands_pb2 import ShellRequest
944+
945+ # Create the request - assumes all inputs are valid and of the proper type
946+ request = ShellRequest (
947+ selection = build_grpc_id (kwargs ["id" ]),
948+ offset = from_measurement_to_server_length (kwargs ["offset" ]),
949+ )
950+
951+ # Call the gRPC service
952+ response = self .command_stub .Shell (request = request )
953+
954+ # Return the response - formatted as a dictionary
955+ return {
956+ "success" : response .success ,
957+ }
958+
959+ @protect_grpc
960+ def remove_faces (self , ** kwargs ) -> dict : # noqa: D102
961+ from ansys .api .geometry .v0 .commands_pb2 import RemoveFacesRequest
962+
963+ # Create the request - assumes all inputs are valid and of the proper type
964+ request = RemoveFacesRequest (
965+ selection = [build_grpc_id (id ) for id in kwargs ["face_ids" ]],
966+ offset = from_measurement_to_server_length (kwargs ["offset" ]),
967+ )
968+
969+ # Call the gRPC service
970+ response = self .command_stub .RemoveFaces (request = request )
971+
972+ # Return the response - formatted as a dictionary
973+ return {
974+ "success" : response .success ,
975+ }
976+
977+ @protect_grpc
978+ def imprint_curves (self , ** kwargs ) -> dict : # noqa: D102
979+ from ansys .api .geometry .v0 .commands_pb2 import ImprintCurvesRequest
980+
981+ # Convert sketch and trimmed curves to gRPC format
982+ sketch = kwargs ["sketch" ]
983+ curves = None
984+ if sketch :
985+ curves = from_sketch_shapes_to_grpc_geometries (sketch .plane , sketch .edges , sketch .faces )
986+
987+ trimmed_curves = None
988+ if kwargs ["tc" ]:
989+ trimmed_curves = [from_trimmed_curve_to_grpc_trimmed_curve (tc ) for tc in kwargs ["tc" ]]
990+
991+ # Create the request - assumes all inputs are valid and of the proper type
992+ request = ImprintCurvesRequest (
993+ body = kwargs ["id" ],
994+ curves = curves ,
995+ faces = kwargs ["face_ids" ],
996+ plane = from_plane_to_grpc_plane (sketch .plane ) if sketch else None ,
997+ trimmed_curves = trimmed_curves ,
998+ )
999+
1000+ # Call the gRPC service
1001+ response = self .command_stub .ImprintCurves (request = request )
1002+
1003+ # Return the response - formatted as a dictionary
1004+ return {
1005+ "edges" : [
1006+ {
1007+ "id" : edge .id ,
1008+ "curve_type" : edge .curve_type ,
1009+ "is_reversed" : edge .is_reversed ,
1010+ }
1011+ for edge in response .edges
1012+ ],
1013+ "faces" : [
1014+ {
1015+ "id" : face .id ,
1016+ "surface_type" : face .surface_type ,
1017+ "is_reversed" : face .is_reversed ,
1018+ }
1019+ for face in response .faces
1020+ ],
1021+ }
1022+
1023+ @protect_grpc
1024+ def project_curves (self , ** kwargs ) -> dict : # noqa: D102
1025+ from ansys .api .geometry .v0 .commands_pb2 import ProjectCurvesRequest
1026+
1027+ # Convert sketch and trimmed curves to gRPC format
1028+ sketch = kwargs ["sketch" ]
1029+ curves = from_sketch_shapes_to_grpc_geometries (
1030+ sketch .plane , sketch .edges , sketch .faces , kwargs ["only_one_curve" ]
1031+ )
1032+
1033+ # Create the request - assumes all inputs are valid and of the proper type
1034+ request = ProjectCurvesRequest (
1035+ body = kwargs ["id" ],
1036+ curves = curves ,
1037+ direction = from_unit_vector_to_grpc_direction (kwargs ["direction" ]),
1038+ closest_face = kwargs ["closest_face" ],
1039+ plane = from_plane_to_grpc_plane (sketch .plane ),
1040+ )
1041+
1042+ # Call the gRPC service
1043+ response = self .command_stub .ProjectCurves (request = request )
1044+
1045+ # Return the response - formatted as a dictionary
1046+ return {
1047+ "faces" : [
1048+ {
1049+ "id" : face .id ,
1050+ "surface_type" : face .surface_type ,
1051+ "is_reversed" : face .is_reversed ,
1052+ }
1053+ for face in response .faces
1054+ ],
1055+ }
1056+
1057+ @protect_grpc
1058+ def imprint_projected_curves (self , ** kwargs ) -> dict : # noqa: D102
1059+ from ansys .api .geometry .v0 .commands_pb2 import ProjectCurvesRequest
1060+
1061+ # Convert sketch and trimmed curves to gRPC format
1062+ sketch = kwargs ["sketch" ]
1063+ curves = from_sketch_shapes_to_grpc_geometries (
1064+ sketch .plane , sketch .edges , sketch .faces , kwargs ["only_one_curve" ]
1065+ )
1066+
1067+ # Create the request - assumes all inputs are valid and of the proper type
1068+ request = ProjectCurvesRequest (
1069+ body = kwargs ["id" ],
1070+ curves = curves ,
1071+ direction = from_unit_vector_to_grpc_direction (kwargs ["direction" ]),
1072+ closest_face = kwargs ["closest_face" ],
1073+ plane = from_plane_to_grpc_plane (sketch .plane ),
1074+ )
1075+
1076+ # Call the gRPC service
1077+ response = self .command_stub .ImprintProjectedCurves (request = request )
1078+
1079+ # Return the response - formatted as a dictionary
1080+ return {
1081+ "faces" : [
1082+ {
1083+ "id" : face .id ,
1084+ "surface_type" : face .surface_type ,
1085+ "is_reversed" : face .is_reversed ,
1086+ }
1087+ for face in response .faces
1088+ ],
1089+ }
0 commit comments