simdesign.rcmrf.geometry.standard
Standard geometry module for defining regular frame structures parametrically.
This module provides the StandardGeometry class for uniform,
rectangular RC moment-resisting frames (equal bay widths and storey heights),
together with six helper functions for encoding and decoding integer tags for
points, lines, and rectangles from their grid indices.
- simdesign.rcmrf.geometry.standard.encode_point_tag(i, j, k, factor=10)[source]
Encode integer grid indices of a point into a single integer tag.
- Parameters:
i (int) – Grid indices along x, y, z respectively (0-based).
j (int) – Grid indices along x, y, z respectively (0-based).
k (int) – Grid indices along x, y, z respectively (0-based).
factor (int, default=10) – Positional base used for encoding. Must be larger than the maximum index value on any axis to avoid collisions.
- Returns:
Encoded point tag as a single integer.
- Return type:
int
Notes
The encoding is:
tag = i * factor**2 + j * factor + k.
- simdesign.rcmrf.geometry.standard.decode_point_tag(tag, factor=10)[source]
Decode a point tag back into integer grid indices.
- Parameters:
tag (int) – Encoded point tag produced by
encode_point_tag().factor (int, default=10) – Positional base used during encoding.
- Returns:
The grid indices
(i, j, k).- Return type:
tuple[int, int, int]
- simdesign.rcmrf.geometry.standard.encode_line_tag(i, j, k, line_type, factor=10)[source]
Encode a line’s anchor grid indices and orientation into a single tag.
- Parameters:
i (int) – Anchor grid indices of the line (the minimum indices along each axis).
j (int) – Anchor grid indices of the line (the minimum indices along each axis).
k (int) – Anchor grid indices of the line (the minimum indices along each axis).
line_type ({'X', 'Y', 'Z'}) – Line orientation axis.
factor (int, default=10) – Positional base used for encoding. Should exceed max index on any axis.
- Returns:
Encoded line tag.
- Return type:
int
Notes
Orientation is encoded as: ‘X’ -> 1, ‘Y’ -> 2, ‘Z’ -> 3, placed in the highest position:
tag = type_code * factor**3 + i * factor**2 + j * factor + k.
- simdesign.rcmrf.geometry.standard.decode_line_tag(tag, factor=10)[source]
Decode a line tag back into anchor grid indices and orientation.
- Parameters:
tag (int) – Encoded line tag produced by
encode_line_tag().factor (int, default=10) – Positional base used during encoding.
- Returns:
(i, j, k, line_type)whereline_typeis one of {‘X’, ‘Y’, ‘Z’}. If the type code is not recognized, ‘?’ is returned.- Return type:
tuple[int, int, int, str]
- simdesign.rcmrf.geometry.standard.encode_rectangle_tag(i, j, k, plane, factor=10)[source]
Encode a rectangle (panel) anchor indices and its plane into a single tag.
- Parameters:
i (int) – Anchor grid indices of the rectangle (lower/near corner).
j (int) – Anchor grid indices of the rectangle (lower/near corner).
k (int) – Anchor grid indices of the rectangle (lower/near corner).
plane ({'XY', 'YZ', 'XZ'}) – The plane in which the rectangle lies.
factor (int, default=10) – Positional base used for encoding. Should exceed max index on any axis.
- Returns:
Encoded rectangle tag.
- Return type:
int
Notes
Plane codes: ‘XY’ -> 1, ‘YZ’ -> 2, ‘XZ’ -> 3.
tag = plane_code * factor**3 + i * factor**2 + j * factor + k.
- simdesign.rcmrf.geometry.standard.decode_rectangle_tag(tag, factor=10)[source]
Decode a rectangle tag back into anchor indices and plane.
- Parameters:
tag (int) – Encoded rectangle tag produced by
encode_rectangle_tag().factor (int, default=10) – Positional base used during encoding.
- Returns:
(i, j, k, plane)whereplaneis one of {‘XY’, ‘YZ’, ‘XZ’}. If the plane code is not recognized, ‘?’ is returned.- Return type:
tuple[int, int, int, str]
- class simdesign.rcmrf.geometry.standard.StandardGeometry(num_storeys, storey_height, num_bays_x, bay_width_x, num_bays_y, bay_width_y, tag=None)[source]
Bases:
GeometryBaseClass representing a standard frame structure.
This class inherits from
GeometryBaseand extends it to represent a standard frame structure. It initializes the frame with the given parameters and constructs the base geometry of the frame. It is called StandardGeometry because its base geometry is built as a uniform and regular frame (equal bay widths and storey heights).- Parameters:
num_storeys (int) – The number of storeys in the frame.
storey_height (float) – The height of each storey.
num_bays_x (int) – The number of bays along the X-direction.
bay_width_x (float) – The width of each bay along the X-direction.
num_bays_y (int) – The number of bays along the Y-direction.
bay_width_y (float) – The width of each bay along the Y-direction.
tag (str | None)
- Variables:
_num_storeys (int) – The number of storeys in the frame.
_num_bays_x (int) – The number of bays along the X-direction.
_num_bays_y (int) – The number of bays along the Y-direction.
_storey_height (float) – The height of each storey.
_bay_width_x (float) – The width of each bay along the X-direction.
_bay_width_y (float) – The width of each bay along the Y-direction.
- add_infills(xz=True, yz=True, ground=True, exterior=True, interior=False, ext_type=None, int_type=None)[source]
Initialize the rectangles representing infill panels in XZ and/or YZ planes of the frame.
- Parameters:
xz (bool, default=True) – If True, add infill rectangles in XZ planes (varying x and z for fixed y).
yz (bool, default=True) – If True, add infill rectangles in YZ planes (varying y and z for fixed x).
ground (bool, default=True) – If True, include panels starting from ground level (k=0..num_storeys-1). If False, start from the first elevated storey (k=1..num_storeys-1).
exterior (bool, default=True) – Include infills on exterior grid lines (i=0 or i=n_x, j=0 or j=n_y).
interior (bool, default=False) – Include infills on interior grid lines (excluding the exterior lines).
ext_type (str | None) – Typology of exterior frame infills. Options: ‘Weak’, ‘Medium’, ‘Strong’.
int_type (str | None) – Typology of interior frame infills Options: ‘Weak’, ‘Medium’, ‘Strong’.
- Return type:
None
Notes
For YZ panels, the fixed-x indices (
i_range) are determined by theyz,exterior, andinteriorswitches.For XZ panels, the fixed-y indices (
j_range) are determined by thexz,exterior, andinteriorswitches.Created rectangles are tagged using
encode_rectangle_tag()with plane ‘YZ’ or ‘XZ’ and assigned the label ‘Infill’.
- add_new_elements_for_stairs(ext_type=None, int_type=None, infills=True)[source]
Adds the new lines (beams) and connecting points for supporting stairs along with the masonry infill walls surrounding the stairs.
This method adds new lines and points to represent stairs in the frame. It identifies rectangles that represent stairs and generates additional points and lines for each staircase within those rectangles. For each staircase, it creates two additional points at mid-storey height, divides the vertical lines passing through these points into two, and adds a beam between the two nodes supporting the staircase loads.
- Parameters:
ext_type (str | None) – Typology of exterior frame infills. Options: ‘Weak’, ‘Medium’, ‘Strong’.
int_type (str | None) – Typology of interior frame infills. Options: ‘Weak’, ‘Medium’, ‘Strong’.
infills (bool, optional) – Flag to add infill walls surrounding the stairs.
- Return type:
None
Notes
Ensure to add the lines and points for stairs after finalizing the base geometry.
The grid IDs at the stair line levels should always end with ‘.5’. For example, for stairs between floor one and two the grid id will be 1.5.
Do not update the grid system after using this method.
TODO
Improve the the behaviour grid id restrictions of stairs.
Add option for defining the supporting beam location