pycufsm.pre.geometry

Attributes

ANGLE_TOLERANCE

Functions

mesh_nodes(→ numpy.ndarray)

Convert centerline coordinates to node coordinates for a cross-section. Note that all meshing parameters are

c_section(→ numpy.ndarray)

Convert cross-section outer dimensions of a "C" section to meshed nodes.

z_section(→ numpy.ndarray)

Convert cross-section outer dimensions of a "Z" section to centerline coordinates. This function does not mesh

f_section(→ numpy.ndarray)

Convert cross-section outer dimensions of a "F" section to centerline coordinates. This function does not mesh

_sfia_thickness_and_radius(→ dict)

Look up the actual thickness and corner radius for SFIA cold-formed steel sections based on designation thickness

_sfia_lip_length(→ float)

Look up the lip length for SFIA cold-formed steel sections based on flange width.

sfia_section(→ numpy.ndarray)

Create a SFIA cold-formed steel section based on its designation. All length units are in inches. This function

Module Contents

pycufsm.pre.geometry.ANGLE_TOLERANCE
pycufsm.pre.geometry.mesh_nodes(centerline_coords: pycufsm._types.ArrayLike, corner_radius: float, mesh_corner_deg: float | None = 22.5, mesh_side_len: float | None = 0.0) numpy.ndarray

Convert centerline coordinates to node coordinates for a cross-section. Note that all meshing parameters are interpreted as maximum values; meshing will always be performed evenly over each curved or straight segment. For example, if a straight segment is 100mm long and the mesh side length is set to 30mm, the actual mesh side length will be 25mm to ensure an even distribution of nodes.

Args:
centerline_coords (array_like): An (N, 2) array of (x, y) coordinates along the centerline of the

cross-section.

corner_radius (float): The radius of the corners of the cross-section. mesh_corner_deg (float, optional): The angle in degrees for meshing the corners. Defaults to 22.5 degrees.

If None, corners will appear as though chamfered, with two points representing the start and end of the corner arc only.

mesh_side_len (float, optional): The desired length of the mesh elements along the sides. Defaults to 0.0,

and if set to this, it will be configured to a quarter of the maximum outer dimension. If None, no meshing will be performed.

Returns:

np.ndarray: An (M, 2) array of (x, y) coordinates for the nodes of the cross-section.

pycufsm.pre.geometry.c_section(b: float, d: float, l: float, t: float, b2: float | None = None, r_inner: float = 0.0, mesh_corner_deg: float | None = 22.5, mesh_side_len: float | None = 0.0) numpy.ndarray

Convert cross-section outer dimensions of a “C” section to meshed nodes.

Args:

b (float): Width of the cross-section. d (float): Depth of the cross-section. l (float): Lip length of the cross-section. t (float): Thickness of the cross-section. b2 (float, optional): Width of the smaller flange of the cross-section. If present, will be placed at the top

of the cross-section. If None, assumed to be equal to b.

r_inner (float, optional): Inner radius of the cross-section corners. Defaults to 0.0. mesh_corner_deg (float, optional): The angle in degrees for meshing the corners. Defaults to 22.5 degrees.

If None, corners will appear as though chamfered, with two points representing the start and end of the corner arc only.

mesh_side_len (float, optional): The desired length of the mesh elements along the sides. Defaults to 0.0,

and if set to this, it will be configured to a quarter of the maximum outer dimension. If None, no meshing will be performed.

Returns:
np.ndarray: An (N, 2) array of (x, y) coordinates along the centerline of the cross-section. Assumes (0,0) is

at the lower left corner.

pycufsm.pre.geometry.z_section(b: float, d: float, l: float, t: float, b2: float | None = None, r_inner: float = 0.0, mesh_corner_deg: float | None = 22.5, mesh_side_len: float | None = 0.0) numpy.ndarray

Convert cross-section outer dimensions of a “Z” section to centerline coordinates. This function does not mesh the cross-section, and does not account for corner radii. If these are needed, run this function’s output through centerline_coords_to_nodes().

Args:

b (float): Width of the cross-section. d (float): Depth of the cross-section. l (float): Lip length of the cross-section. t (float): Thickness of the cross-section. b2 (float, optional): Width of the smaller flange of the cross-section. If present, will be placed at the top

of the cross-section. If None, assumed to be equal to b.

r_inner (float, optional): Inner radius of the cross-section corners. Defaults to 0.0. mesh_corner_deg (float, optional): The angle in degrees for meshing the corners. Defaults to 22.5 degrees.

If None, corners will appear as though chamfered, with two points representing the start and end of the corner arc only.

mesh_side_len (float, optional): The desired length of the mesh elements along the sides. Defaults to 0.0,

and if set to this, it will be configured to a quarter of the maximum outer dimension. If None, no meshing will be performed.

Returns:
np.ndarray: An (N, 2) array of (x, y) coordinates along the centerline of the cross-section. Assumes (0,0) is

at the lower left corner.

pycufsm.pre.geometry.f_section(b: float, d: float, l: float, t: float, r_inner: float = 0.0, mesh_corner_deg: float | None = 22.5, mesh_side_len: float | None = 0.0) numpy.ndarray

Convert cross-section outer dimensions of a “F” section to centerline coordinates. This function does not mesh the cross-section, and does not account for corner radii. If these are needed, run this function’s output through centerline_coords_to_nodes().

Args:

b (float): Width of the cross-section. d (float): Depth of the cross-section. l (float): Lip length of the cross-section. t (float): Thickness of the cross-section. r_inner (float, optional): Inner radius of the cross-section corners. Defaults to 0.0. mesh_corner_deg (float, optional): The angle in degrees for meshing the corners. Defaults to 22.5 degrees.

If None, corners will appear as though chamfered, with two points representing the start and end of the corner arc only.

mesh_side_len (float, optional): The desired length of the mesh elements along the sides. Defaults to 0.0,

and if set to this, it will be configured to a quarter of the maximum outer dimension. If None, no meshing will be performed.

Returns:
np.ndarray: An (N, 2) array of (x, y) coordinates along the centerline of the cross-section. Assumes (0,0) is

at the lower left corner.

pycufsm.pre.geometry._sfia_thickness_and_radius(designation: int, thickness_type: Literal['minimum', 'design'] = 'design') dict

Look up the actual thickness and corner radius for SFIA cold-formed steel sections based on designation thickness in mils.

Args:

designation (int): The SFIA designation thickness in mils (e.g., 18, 27, 30, etc.). thickness_type (str, optional): Type of thickness to use, either “minimum” or “design”. Defaults to “design”.

Returns:
dict: A dictionary containing:
  • t (float): The thickness based on the specified thickness type.

  • r (float): The centerline radius of the section.

  • t_min (float): The minimum thickness of the section.

  • t_design (float): The design thickness of the section.

  • r_inner (float): The inner radius of the section.

  • reference_gauge (str): The reference gauge for the designation.

Raises:
ValueError: If the designation is not found in the thickness table or if the thickness_type is not “minimum”

or “design”.

pycufsm.pre.geometry._sfia_lip_length(flange_width: int) float

Look up the lip length for SFIA cold-formed steel sections based on flange width.

Args:

flange_width (int): The flange width in hundredths of an inch (e.g., 200 for 2.00 inches).

Returns:

float: The lip length in inches.

pycufsm.pre.geometry.sfia_section(designation: str, mesh_corner_deg: float | None = 22.5, mesh_side_len: float | None = 0.0) numpy.ndarray

Create a SFIA cold-formed steel section based on its designation. All length units are in inches. This function supports “C”, “S”, “T”, “U”, “Z”, and “F” section types.

Args:

designation (str): The SFIA designation of the section (e.g., “362S200-43”).

Returns:

np.ndarray: An (N, 2) array of (x, y) coordinates for the nodes of the cross-section.

Raises:

ValueError: If the designation format is invalid or if the section type is unknown.