Skip to content

Commit 578eb69

Browse files
Modify AngleSection formulation to account for zero radius
1 parent 7d6cf6d commit 578eb69

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

sectionproperties/pre/sections.py

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,40 +1724,50 @@ def __init__(self, d, b, t, r_r, r_t, n_r, shift=[0, 0]):
17241724
self.points.append([b, 0])
17251725

17261726
# construct the bottom toe radius
1727-
for i in range(n_r):
1728-
# determine polar angle
1729-
theta = i * 1.0 / max(1, n_r - 1) * np.pi * 0.5
1727+
if r_t == 0:
1728+
self.points.append([b, t])
1729+
else:
1730+
for i in range(n_r):
1731+
# determine polar angle
1732+
theta = i * 1.0 / max(1, n_r - 1) * np.pi * 0.5
17301733

1731-
# calculate the locations of the radius points
1732-
x = b - r_t + r_t * np.cos(theta)
1733-
y = t - r_t + r_t * np.sin(theta)
1734+
# calculate the locations of the radius points
1735+
x = b - r_t + r_t * np.cos(theta)
1736+
y = t - r_t + r_t * np.sin(theta)
17341737

1735-
# append the current points to the points list
1736-
self.points.append([x, y])
1738+
# append the current points to the points list
1739+
self.points.append([x, y])
17371740

17381741
# construct the root radius
1739-
for i in range(n_r):
1740-
# determine polar angle
1741-
theta = 3.0 / 2 * np.pi * (1 - i * 1.0 / max(1, n_r - 1) * 1.0 / 3)
1742+
if r_r == 0:
1743+
self.points.append([t, t])
1744+
else:
1745+
for i in range(n_r):
1746+
# determine polar angle
1747+
theta = 3.0 / 2 * np.pi * (1 - i * 1.0 / max(
1748+
1, n_r - 1) * 1.0 / 3)
17421749

1743-
# calculate the locations of the radius points
1744-
x = t + r_r + r_r * np.cos(theta)
1745-
y = t + r_r + r_r * np.sin(theta)
1750+
# calculate the locations of the radius points
1751+
x = t + r_r + r_r * np.cos(theta)
1752+
y = t + r_r + r_r * np.sin(theta)
17461753

1747-
# append the current points to the points list
1748-
self.points.append([x, y])
1754+
# append the current points to the points list
1755+
self.points.append([x, y])
17491756

17501757
# construct the top toe radius
1751-
for i in range(n_r):
1752-
# determine polar angle
1753-
theta = i * 1.0 / max(1, n_r - 1) * np.pi * 0.5
1758+
if r_t == 0:
1759+
self.points.append([t, d])
1760+
else:
1761+
for i in range(n_r):
1762+
# determine polar angle
1763+
theta = i * 1.0 / max(1, n_r - 1) * np.pi * 0.5
17541764

1755-
# calculate the locations of the radius points
1756-
x = t - r_t + r_t * np.cos(theta)
1757-
y = d - r_t + r_t * np.sin(theta)
1765+
# calculate the locations of the radius points
1766+
x = t - r_t + r_t * np.cos(theta)
1767+
y = d - r_t + r_t * np.sin(theta)
17581768

1759-
# append the current points to the points list
1760-
self.points.append([x, y])
1769+
# append the current points to the points list
1770+
self.points.append([x, y])
17611771

17621772
# add the next point
17631773
self.points.append([0, d])

0 commit comments

Comments
 (0)