5858from ansys .api .geometry .v0 .models_pb2 import Direction , Line , TrimmedCurveList
5959from ansys .geometry .core .connection .client import GrpcClient
6060from ansys .geometry .core .connection .conversions import (
61+ grpc_curve_to_curve ,
62+ grpc_frame_to_frame ,
6163 grpc_material_to_material ,
6264 grpc_matrix_to_matrix ,
6365 grpc_point_to_point3d ,
6870 trimmed_surface_to_grpc_trimmed_surface ,
6971 unit_vector_to_grpc_direction ,
7072)
71- from ansys .geometry .core .designer .beam import Beam , BeamProfile
73+ from ansys .geometry .core .designer .beam import (
74+ Beam ,
75+ BeamCrossSectionInfo ,
76+ BeamProfile ,
77+ BeamProperties ,
78+ SectionAnchorType ,
79+ )
7280from ansys .geometry .core .designer .body import Body , CollisionType , MasterBody
7381from ansys .geometry .core .designer .coordinate_system import CoordinateSystem
7482from ansys .geometry .core .designer .designpoint import DesignPoint
8896from ansys .geometry .core .misc .measurements import DEFAULT_UNITS , Angle , Distance
8997from ansys .geometry .core .shapes .curves .circle import Circle
9098from ansys .geometry .core .shapes .curves .trimmed_curve import TrimmedCurve
91- from ansys .geometry .core .shapes .parameterization import Interval
99+ from ansys .geometry .core .shapes .parameterization import Interval , ParamUV
92100from ansys .geometry .core .shapes .surfaces import TrimmedSurface
93101from ansys .geometry .core .sketch .arc import Arc
94102from ansys .geometry .core .sketch .sketch import Sketch
@@ -1238,6 +1246,31 @@ def __create_beams(
12381246
12391247 beams = []
12401248 for beam in response .created_beams :
1249+ print (beam .cross_section .section_profile )
1250+ cross_section = BeamCrossSectionInfo (
1251+ SectionAnchorType (beam .cross_section .section_anchor ),
1252+ beam .cross_section .section_angle ,
1253+ grpc_frame_to_frame (beam .cross_section .section_frame ),
1254+ [
1255+ [TrimmedCurve (
1256+ grpc_curve_to_curve (curve .geometry ),
1257+ grpc_point_to_point3d (curve .start ),
1258+ grpc_point_to_point3d (curve .end ),
1259+ Interval (curve .interval_start , curve .interval_end ),
1260+ curve .length ) for curve in curve_list ]
1261+ for curve_list in beam .cross_section .section_profile ],
1262+ )
1263+ properties = BeamProperties (
1264+ beam .properties .area ,
1265+ ParamUV (beam .properties .centroid_x , beam .properties .centroid_y ),
1266+ beam .properties .warping_constant ,
1267+ beam .properties .ixx ,
1268+ beam .properties .ixy ,
1269+ beam .properties .iyy ,
1270+ ParamUV (beam .properties .shear_center_x , beam .properties .shear_center_y ),
1271+ beam .properties .torsional_constant ,
1272+ )
1273+
12411274 beams .append (
12421275 Beam (
12431276 beam .id .id ,
@@ -1250,10 +1283,8 @@ def __create_beams(
12501283 beam .is_reversed ,
12511284 beam .is_rigid ,
12521285 grpc_material_to_material (beam .material ),
1253- None ,
1254- None ,
1255- # grpc_cross_section_to_cross_section(beam.cross_section),
1256- # grpc_beam_properties_to_beam_properties(beam.properties),
1286+ cross_section ,
1287+ properties ,
12571288 beam .shape ,
12581289 beam .type ,
12591290 )
0 commit comments