concreteproperties.pre.CPGeomConcrete#

class CPGeomConcrete(geom, material)[source]#

Bases: CPGeom

concreteproperties Geometry class for concrete geometries.

Inits the CPGeomConcrete class.

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

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

Methods

calculate_area

Calculates the area of the geometry.

calculate_centroid

Calculates the centroid of the geometry.

calculate_extents

Calculates the minimum and maximum x and y values among the points describing 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 string defined by a point and vector and bounded by bounds.

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.

calculate_area()#

Calculates the area of the geometry.

Returns

float – Geometry area

calculate_centroid()#

Calculates the centroid of the geometry.

Returns

Tuple[float, float] – Geometry centroid

calculate_extents()#

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

Returns

Tuple[float, float, float, float] – Extents (x_min, x_max, y_min, y_max)

create_facets(points_list, offset=0)#

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, default: 0) – Facet offset integer

Returns

List[Tuple[int, int]] – List of facets

create_line_segment(point, vector, bounds)#

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

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

  • vector (Tuple[float, float]) – Vector defining direction of line

  • bounds (Tuple[float, float, float, float]) – Bounds of the geometry

Returns

LineString – Shapely line string

create_points_and_facets(geometry)#

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

plot_geometry(title='Cross-Section Geometry', **kwargs)#

Plots the geometry.

Parameters
  • title (str, default: 'Cross-Section Geometry') – Plot title

  • kwargs – Passed to plot_geometry()

Returns

Axes – Matplotlib axes object

round_geometry(geometry, tol)#

Rounds the coordinates in geometry to tolerance tol.

Parameters
  • geometry (Polygon) – Geometry to round

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

Returns

Polygon – Rounded geometry

sort_polys(polys, point, vector)#

Sorts polygons that are above and below the line.

Parameters
  • polys (List[Polygon]) – Polygons to sort

  • point (Tuple[float, float]) – Point on line

  • vector (Tuple[float, float]) – Vector defining direction of line

Returns

Tuple[List[Polygon], List[Polygon]] – Polygons above and below the line

split_section(point, theta)#

Splits the geometry about a line.

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

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

Returns

Tuple[List[CPGeom], List[CPGeom]] – Geometries above and below the line

to_sp_geom()#

Converts self to a sectionproperties geometry object.

Returns

Geometrysectionproperties geometry object