import copy
import sectionproperties.pre.sections as sections
from sectionproperties.analysis.cross_section import CrossSection
# -------------------------------------------------------------
# Inputs
# -------------------------------------------------------------
top_flg = False
d = 612 # I-section depth
b_f = 229 # I-section flange width
t_f = 19.6 # I-section flange thickness
t_w = 11.9 # I-section web thickness
r_1 = 14 # I-section root radii
d_1 = 612 # strengthening I-Section depth
b_f1 = 229 # strengthening I-Section flange width
t_f1 = 19.6 # strenghtening I-Section flange thickness
t_w1 = 11.9 # strengthening I-Section web thickness
r_2 = 14 # strengthening I-Section root radii
gap = 0.3 # gap between I-Sections
weld_size = 10 # weld size
n_r = 20 # number of points considered around root radii
mesh_area = 10 # max mesh size
# -------------------------------------------------------------
# Calculations
# -------------------------------------------------------------
# create constituent geometry
# weld base geometry
weld = sections.CustomSection(
points=[[0, 0], [weld_size, 0], [0, weld_size]], facets=[[0, 1], [1, 2], [2, 0]], holes=[], control_points=[[weld_size / 3, weld_size / 3]]
)
if d_1 > b_f and not gap == 0:
weld_vert_move = -gap
else:
weld_vert_move = 0
# I-Section beam
geometry1 = sections.ISection(d=d, b=b_f, t_f=t_f, t_w=t_w, r=r_1, n_r=n_r, shift=[-b_f / 2, -d / 2])
# strengthening I-Section
if top_flg:
geometry2 = sections.ISection(d=d_1, b=b_f1, t_f=t_f1, t_w=t_w1, r=r_2, n_r=n_r, shift=[-b_f1 / 2, d / 2 - d_1 / 2 + gap + t_w1 / 2])
geometry2.rotate_section(angle=-90, rot_point=[0, d / 2 + gap + t_w1 / 2])
else:
geometry2 = sections.ISection(d=d_1, b=b_f1, t_f=t_f1, t_w=t_w1, r=r_2, n_r=n_r, shift=[-b_f1 / 2, -d / 2 - d_1 / 2 - gap - t_w1 / 2])
geometry2.rotate_section(angle=-90, rot_point=[0, -d / 2 - gap - t_w1 / 2])
# weld 1 & 2
geometry3 = copy.deepcopy(weld)
if b_f > d_1:
geometry3.mirror_section(axis='x', mirror_point=[0, 0])
geometry3.shift = [min(d_1 / 2, b_f / 2), -d / 2 + weld_vert_move]
geometry3.shift_section()
geometry4 = copy.deepcopy(geometry3)
geometry4.mirror_section(axis='y', mirror_point=[0, 0])
if top_flg:
geometry3.mirror_section(axis='x', mirror_point=[0, 0])
geometry4.mirror_section(axis='x', mirror_point=[0, 0])
# total number of individual geometry elements
geo_number = 4
# assemble geometry list
geo_list = [globals()[f'geometry{i}'] for i in range(1, geo_number + 1)]
# create merged section
geometry = sections.MergedSection(geo_list)
# add holes for gaps between I-Section and strengthening tee
if not gap == 0:
if top_flg:
geometry.add_hole([0, d / 2 + gap / 2])
else:
geometry.add_hole([0, -d / 2 - gap / 2])
# clean geometry
geometry.clean_geometry(verbose=True)
# create mesh
mesh = geometry.create_mesh(mesh_sizes=[mesh_area] * geo_number)
# create section
section = CrossSection(geometry, mesh)
# calculate results
section.calculate_geometric_properties()
section.calculate_plastic_properties()
section.calculate_warping_properties()
# -------------------------------------------------------------
# Display results
# -------------------------------------------------------------
# plot results
section.plot_mesh()
section.plot_centroids()
# display all results
# check [URL unfurl="true"]https://sectionproperties.readthedocs.io/en/latest/rst/post.html[/URL] for definitions
section.display_results(fmt='.3f')