section-properties icon indicating copy to clipboard operation
section-properties copied to clipboard

`CompoundGeometry.offset_perimeter()` with positive `amount` creates overlapping geometry

Open robbievanleeuwen opened this issue 9 months ago • 1 comments

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: Screenshot 2023-10-09 at 10 08 26 pm

robbievanleeuwen avatar Oct 09 '23 11:10 robbievanleeuwen