group_top_and_bottom_polys

sectionproperties.pre.bisect_section.group_top_and_bottom_polys(polys: GeometryCollection, line: LineString) tuple[list[Polygon], list[Polygon]][source]

Sort polygons into groups above and below a line.

Returns a tuple of two lists representing the list of polygons in polys on the “top” side of line and the list of polygons on the “bottom” side of the line after the original geometry has been split by line.

The 0th tuple element is the “top” polygons and the 1st element is the “bottom” polygons.

In the event that line is a perfectly vertical line, the “top” polys are the polygons on the “right” of the line and the “bottom” polys are the polygons on the “left” of the line.

Parameters:
Raises:

RuntimeError – If the split operation does not generate polygons

Returns:

List of polygons above and below the line

Return type:

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