from shapely import Polygon

from sectionproperties.pre import Material
from sectionproperties.pre.library import rectangular_section
from sectionproperties.analysis import Section

# create steel and timber materials
steel = Material(
    name="Steel",
    elastic_modulus=200e3,
    poissons_ratio=0.3,
    density=7.85e-6,
    yield_strength=500,
    color="grey",
)
timber = Material(
    name="Timber",
    elastic_modulus=8e3,
    poissons_ratio=0.35,
    density=6.5e-7,
    yield_strength=20,
    color="burlywood",
)

# create the individual geometries with material properties applied
beam = rectangular_section(d=170, b=35, material=timber)
plate = rectangular_section(d=16, b=35, material=steel)

# combine geometries, maintaining assigned materials
geom = beam + plate.shift_section(y_offset=-16)

# mesh and plot
geom.create_mesh(mesh_sizes=[20, 10])
Section(geometry=geom).plot_mesh()