CPGeomConcrete#

class concreteproperties.pre.CPGeomConcrete(geom: Polygon, material: Concrete)[source]#

Bases: CPGeom

A concreteproperties Geometry object for concrete geometries.

Methods

calculate_area

Calculates the area of the geometry.

calculate_centroid

Calculates the centroid of the geometry.

calculate_extents

Calculates the extents of the geometry.

create_facets

Generates a list of facets given a list of points and a facet offset.

create_line_segment

Creates a shapely line.

create_points_and_facets

Creates a list of points and facets from a shapely polygon.

plot_geometry

Plots the geometry.

round_geometry

Rounds the coordinates in geometry to tolerance tol.

sort_polys

Sorts polygons that are above and below the line.

split_section

Splits the geometry about a line.

to_sp_geom

Converts self to a sectionproperties geometry object.

__init__(geom: Polygon, material: Concrete) None[source]#

Inits the CPGeomConcrete class.

Parameters:
  • geom (Polygon) – Shapely polygon defining the geometry

  • material (Concrete) – Material to apply to the geometry

calculate_area() float#

Calculates the area of the geometry.

Returns:

Geometry area

Return type:

float

calculate_centroid() tuple[float, float]#

Calculates the centroid of the geometry.

Returns:

Geometry centroid

Return type:

tuple[float, float]

calculate_extents() tuple[float, float, float, float]#

Calculates the extents of the geometry.

Calculates the minimum and maximum x and y values among the points describing the geometry.

Returns:

Extents (x_min, x_max, y_min, y_max)

Return type:

tuple[float, float, float, float]

create_facets(points_list: list[tuple[float, float]], offset: int = 0) list[tuple[int, int]]#

Generates a list of facets given a list of points and a facet offset.

Parameters:
  • points_list (list[tuple[float, float]]) – List of ordered points to create facets from

  • offset (int) – Facet offset integer

Returns:

List of facets

Return type:

list[tuple[int, int]]

create_line_segment(point: tuple[float, float], vector: tuple[float, float], bounds: tuple[float, float, float, float]) LineString#

Creates a shapely line.

Creates a shapely line string defined by a point and vector and bounded by bounds.

Parameters:
Returns:

Shapely line string

Return type:

LineString

create_points_and_facets(geometry: Polygon) tuple[list[tuple[float, float]], list[tuple[int, int]]]#

Creates a list of points and facets from a shapely polygon.

Parameters:

geometry (Polygon) – Shapely polygon from which to create points and facets

Returns:

Points and facets

Return type:

tuple[list[tuple[float, float]], list[tuple[int, int]]]

plot_geometry(title: str = 'Cross-Section Geometry', **kwargs) matplotlib.axes.Axes#

Plots the geometry.

Parameters:
Returns:

Matplotlib axes object

Return type:

matplotlib.axes.Axes

round_geometry(geometry: Polygon, tol: int) Polygon#

Rounds the coordinates in geometry to tolerance tol.

Parameters:
  • geometry (Polygon) – Geometry to round

  • tol (int) – Number of decimal places to round

Returns:

Rounded geometry

Return type:

Polygon

sort_polys(polys: list[Polygon], point: tuple[float, float], vector: tuple[float, float]) tuple[list[Polygon], list[Polygon]]#

Sorts polygons that are above and below the line.

Parameters:
Returns:

Polygons above and below the line

Return type:

tuple[list[Polygon], list[Polygon]]

split_section(point: tuple[float, float], theta: float) tuple[list[CPGeom], list[CPGeom]]#

Splits the geometry about a line.

Parameters:
  • point (tuple[float, float]) – Point on line

  • theta (float) – Angle line makes with horizontal axis

Returns:

Geometries above and below the line

Return type:

tuple[list[CPGeom], list[CPGeom]]

to_sp_geom() Geometry#

Converts self to a sectionproperties geometry object.

Returns:

sectionproperties geometry object

Return type:

Geometry