find_largest_rectangle_inside_polygon#
- static GeometryOperators.find_largest_rectangle_inside_polygon(polygon: list, partition_max_order: int = 16) list#
Find the largest area rectangles of arbitrary orientation in a polygon.
Implements the algorithm described by Rubén Molano, et al. “Finding the largest area rectangle of arbitrary orientation in a closed contour”, published in Applied Mathematics and Computation. https://doi.org/10.1016/j.amc.2012.03.063. (https://www.sciencedirect.com/science/article/pii/S0096300312003207)
- Parameters:
- polygon
List [[x1, x2, …, xn],[y1, y2, …, yn]]
- partition_max_order
float,optional Order of the lattice partition used to find the quasi-lattice polygon that approximates
polygon. Default is16.
- polygon
- Returns:
ListofListList containing the rectangles points. Return all rectangles found. List is in the form: [[[x1, y1],[x2, y2],…],[[x1, y1],[x2, y2],…],…].