section-properties
section-properties copied to clipboard
`CompoundGeometry.offset_perimeter()` with positive `amount` creates overlapping geometry
See below example:
from sectionproperties.pre.geometry import check_geometry_overlaps
from sectionproperties.pre.library import rectangular_section
from sectionproperties.analysis import Section
# create two rectangles side-by-side
rect1 = rectangular_section(d=50, b=50)
rect2 = rectangular_section(d=50, b=50).align_to(rect1, "right")
geom = rect1 + rect2
# dilate the exterior by 5 units
geom = geom.offset_perimeter(amount=5, where="exterior")
# ensure there are no overlaps
print(check_geometry_overlaps([g.geom for g in geom.geoms]))
# plot mesh
geom.create_mesh(mesh_sizes=[0])
Section(geometry=geom).plot_mesh(materials=False)
check_geometry_overlaps()
returns True
- this should be False
.
Mesh plot shows two semi-circles overlapping the existing rectangles in the regions where the two rectangles meet: