Skip to content

Commit 2067656

Browse files
Add second balloon test (3 rectangles)
1 parent b573433 commit 2067656

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/geometry/test_offset.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_compound_rectangular_offset():
107107
area = 90 * 40
108108
check.almost_equal(section.get_area(), area, rel=r_tol)
109109

110-
# balloon case
110+
# balloon case (two rectangles)
111111
geom = rect1 + rect2
112112
geom = geom.offset_perimeter(amount=5, where="exterior")
113113

@@ -121,6 +121,20 @@ def test_compound_rectangular_offset():
121121
area = 100 * 50 + 2 * (5 * 100 + 5 * 50) + np.pi * 5**2
122122
check.almost_equal(section.get_area(), area, rel=r_tol)
123123

124+
# balloon case (three rectangles)
125+
geom = rect1 + rect2 + rect1.align_to(rect2, "right")
126+
geom = geom.offset_perimeter(amount=5, where="exterior")
127+
128+
# ensure there are no overlaps
129+
assert not check_geometry_overlaps([g.geom for g in geom.geoms])
130+
131+
# calculate area
132+
geom.create_mesh(mesh_sizes=[0])
133+
section = Section(geometry=geom)
134+
section.calculate_geometric_properties()
135+
area = 150 * 50 + 2 * (5 * 150 + 5 * 50) + np.pi * 5**2
136+
check.almost_equal(section.get_area(), area, rel=r_tol)
137+
124138

125139
def test_compound_rectangular_isection_offset_corrode():
126140
"""Tests offsets for a complex compound section."""

0 commit comments

Comments
 (0)