simdesign.utils.mesh
This module provides the classes used for defining structural meshes with varying geometries.
- class simdesign.utils.mesh.Shape(tag)[source]
Bases:
ABCAbstract base class for geometric shapes.
- Variables:
tag (Optional[int]) – Unique identifier for the shape.
- Parameters:
tag (int | None)
- tag: int | None
- abstract property ndim: int
Return the number of dimensions of the shape.
- Returns:
Number of dimensions.
- Return type:
int
- class simdesign.utils.mesh.Point(grid, coordinates, tag)[source]
Bases:
ShapePoint in 3D space defined by grid IDs and coordinates.
- Variables:
grid_ids (List[Union[int, float]]) – Point grid identifiers (x, y, z).
coordinates (List[float]) – Point coordinates (x, y, z).
- Parameters:
grid (List[int | float])
coordinates (List[float])
tag (int | None)
- grid_ids: List[int | float]
- coordinates: List[float]
- property ndim: int
Return the number of dimensions (always 0 for a point).
- Returns:
Number of dimensions (always 0 for a point).
- Return type:
int
- class simdesign.utils.mesh.Line(points, tag=None)[source]
Bases:
ShapeStraight line segment defined by two points.
- Variables:
points (List[Point]) – List of points defining the line.
- Parameters:
points (List[Point])
tag (int | None)
- property direction_vector: ndarray
Return the direction vector of the line.
- Returns:
Direction vector of the line.
- Return type:
np.ndarray
- property unit_vector: ndarray
Return the unit vector of the line.
- Returns:
Unit vector of the line.
- Return type:
np.ndarray
- property ndim: int
Return the number of dimensions (always 1 for a line).
- Returns:
Number of dimensions (always 1 for a line).
- Return type:
int
- property length: float64
Return the line length.
- Returns:
Line length.
- Return type:
np.float64
- class simdesign.utils.mesh.Polygon(points, lines=None, tag=None)[source]
Bases:
ShapeFlat polygon defined by an ordered list of coplanar points.
- Variables:
- Parameters:
- property ndim: int
Return the number of dimensions (always 2 for a polygon).
- Returns:
Number of dimensions (always 2 for a polygon).
- Return type:
int
- property vertices: ndarray
Return the vertices of the polygon as a 2D array.
- Returns:
Vertices of the polygon.
- Return type:
np.ndarray
- property centroid: ndarray
Return the centroid coordinates of the polygon.
- Returns:
Coordinates of the centroid of the polygon.
- Return type:
np.ndarray
- property normal_vector: ndarray
Return the normal vector of the polygon.
- Returns:
Normal vector of the polygon.
- Return type:
np.ndarray
- property unit_normal_vector: ndarray
Return the unit normal vector of the polygon.
- Returns:
Unit normal vector of the polygon.
- Return type:
np.ndarray
- property perimeter: float
Return the perimeter of the polygon.
- Returns:
Polygon perimeter.
- Return type:
float
- property area: float
Return the area of the polygon.
- Returns:
Polygon area.
- Return type:
float
- sort_points_xyz_ccw()[source]
Sort the polygon’s points counter-clockwise starting from the lowest (x, y, z) point.
- Return type:
None
- class simdesign.utils.mesh.Quadrilateral(points, lines=None, tag=None)[source]
Bases:
PolygonQuadrilateral defined as a polygon with exactly four sides and four vertices.
- class simdesign.utils.mesh.Parallelogram(points, lines=None, tag=None)[source]
Bases:
QuadrilateralParallelogram defined as a quadrilateral with both pairs of opposite sides parallel.
- class simdesign.utils.mesh.Rectangle(points, lines=None, tag=None)[source]
Bases:
ParallelogramRectangled defined as a parallelogram whose four interior angles are all right angles.
- class simdesign.utils.mesh.Square(points, lines=None, tag=None)[source]
Bases:
RectangleSquare defined as a rectangle whose four sides are all of equal length.
- class simdesign.utils.mesh.Trapezoid(points, lines=None, tag=None)[source]
Bases:
QuadrilateralTrapezoid defined as a quadrilateral with at least one pair of parallel opposite sides.