Plot Centroids#
This example demonstrates how to plot centroids in sectionproperties
.
The plot_centroids()
method will display a plot of the finite element mesh along with any centroids that have been calculated:
Geometric analysis - geometric centroid and principal axes
Warping analysis - shear centre
Plastic analysis - plastic centroid
This example will plot the centroids for a 200 mm deep and 12 mm thick bulb section with a 10 mm radius.
[1]:
from sectionproperties.pre.library import bulb_section
from sectionproperties.analysis import Section
geom = bulb_section(d=200, b=50, t=12, r=10, n_r=8)
geom.create_mesh(mesh_sizes=20)
sec = Section(geometry=geom)
sec.plot_mesh(materials=False)
[1]:
<Axes: title={'center': 'Finite Element Mesh'}>
Geometric Analysis#
[2]:
sec.calculate_geometric_properties()
sec.plot_centroids()
[2]:
<Axes: title={'center': 'Centroids'}>
Warping Analysis#
Note that the title and transparency can be changed by specifying title
and alpha
respectively.
[3]:
sec.calculate_warping_properties()
sec.plot_centroids(title="Geometric & Warping Centroids", alpha=0.2)
[3]:
<Axes: title={'center': 'Geometric & Warping Centroids'}>
Plastic Analysis#
[4]:
sec.calculate_plastic_properties()
sec.plot_centroids()
[4]:
<Axes: title={'center': 'Centroids'}>