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 ofline
and the list of polygons on the “bottom” side of theline
after the original geometry has been split byline
.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 theline
and the “bottom” polys are the polygons on the “left” of theline
.- Parameters:
polys (GeometryCollection) – Collection of polygons to sort
line (LineString) – Line about which polygons have been split
- Returns:
List of polygons above and below the line
- Return type: