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