Skip to content

Commit 93257c0

Browse files
Merge pull request #493 from robbievanleeuwen/feature/rhs-r-in
Add inner radius argument to `rectangular_hollow_section()`
2 parents 262cd82 + 7690ec2 commit 93257c0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/sectionproperties/pre/library/steel_sections.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,28 @@ def rectangular_hollow_section(
151151
t: float,
152152
r_out: float,
153153
n_r: int,
154+
r_in: float | None = None,
154155
material: pre.Material = pre.DEFAULT_MATERIAL,
155156
) -> geometry.Geometry:
156157
"""Constructs a rectangular hollow section (RHS).
157158
158159
Constructs a rectangular hollow section (RHS) centered at ``(b/2, d/2)``, with depth
159-
``d``, width ``b``, thickness ``t`` and outer radius ``r_out``, using ``n_r`` points
160-
to construct the inner and outer radii. If the outer radius is less than the
161-
thickness of the RHS, the inner radius is set to zero.
160+
``d``, width ``b``, thickness ``t``, outer radius ``r_out`` and inner radius
161+
``r_in``, using ``n_r`` points to construct the inner and outer radii.
162+
163+
If the inner radius is not specified, it defaults to the difference between the
164+
outer radius and the thickness of the section, i.e. ``r_in = r_out - t``. In this
165+
case, if the outer radius is less than the thickness of the RHS, the inner radius is
166+
set to zero.
162167
163168
Args:
164169
d: Depth of the RHS
165170
b: Width of the RHS
166171
t: Thickness of the RHS
167172
r_out: Outer radius of the RHS
168173
n_r: Number of points discretising the inner and outer radii
174+
r_in: Inner radius of the RHS. Defaults to ``None``, which implies
175+
``r_in = max(r_out - t, 0)``.
169176
material: Material to associate with this geometry. Defaults to
170177
``pre.DEFAULT_MATERIAL``.
171178
@@ -192,7 +199,8 @@ def rectangular_hollow_section(
192199
points_outer: list[tuple[float, float]] = []
193200

194201
# calculate internal radius
195-
r_in = max(r_out - t, 0)
202+
if r_in is None:
203+
r_in = max(r_out - t, 0)
196204

197205
# construct the outer radius points
198206
points_outer += sp_utils.draw_radius((r_out, r_out), r_out, np.pi, n_r)

0 commit comments

Comments
 (0)