concreteproperties.pre.CPGeom#
- class CPGeom(geom, material)[source]#
Bases:
objectWatered down implementation of the sectionproperties Geometry object, optimised for concreteproperties.
Inits the CPGeom class.
- Parameters
geom (
Polygon) – Shapely polygon defining the geometrymaterial (
Material) – Material to apply to the geometry
Methods
Calculates the area of the geometry.
Calculates the centroid of the geometry.
Calculates the minimum and maximum
xandyvalues among the points describing the geometry.Generates a list of facets given a list of points and a facet offset.
Creates a shapely line string defined by a
pointandvectorand bounded bybounds.Creates a list of points and facets from a shapely polygon.
Plots the geometry.
Rounds the coordinates in
geometryto tolerancetol.Sorts polygons that are above and below the line.
Splits the geometry about a line.
Converts self to a sectionproperties geometry object.
- round_geometry(geometry, tol)[source]#
Rounds the coordinates in
geometryto tolerancetol.- Parameters
geometry (
Polygon) – Geometry to roundtol (
int) – Number of decimal places to round
- Returns
Polygon– Rounded geometry
- create_points_and_facets(geometry)[source]#
Creates a list of points and facets from a shapely polygon.
- Parameters
geometry (
Polygon) – Shapely polygon from which to create points and facets- Returns
Tuple[List[Tuple[float,float]],List[Tuple[int,int]]] – Points and facets
- create_facets(points_list, offset=0)[source]#
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 fromoffset (
int, default:0) – Facet offset integer
- Returns
List[Tuple[int,int]] – List of facets
- calculate_centroid()[source]#
Calculates the centroid of the geometry.
- Returns
Tuple[float,float] – Geometry centroid
- calculate_extents()[source]#
Calculates the minimum and maximum
xandyvalues among the points describing the geometry.- Returns
Tuple[float,float,float,float] – Extents (x_min,x_max,y_min,y_max)
- create_line_segment(point, vector, bounds)[source]#
Creates a shapely line string defined by a
pointandvectorand bounded bybounds.- Parameters
point (
Tuple[float,float]) – Point on linevector (
Tuple[float,float]) – Vector defining direction of linebounds (
Tuple[float,float,float,float]) – Bounds of the geometry
- Returns
LineString– Shapely line string
- sort_polys(polys, point, vector)[source]#
Sorts polygons that are above and below the line.
- Parameters
polys (
List[Polygon]) – Polygons to sortpoint (
Tuple[float,float]) – Point on linevector (
Tuple[float,float]) – Vector defining direction of line
- Returns
Tuple[List[Polygon],List[Polygon]] – Polygons above and below the line
- plot_geometry(title='Cross-Section Geometry', **kwargs)[source]#
Plots the geometry.
- Parameters
title (
str, default:'Cross-Section Geometry') – Plot titlekwargs – Passed to
plot_geometry()
- Returns
Axes– Matplotlib axes object