find_largest_rectangle_inside_polygon#

static GeometryOperators.find_largest_rectangle_inside_polygon(polygon, partition_max_order=16)[source]#

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:
polygonList

[[x1, x2, …, xn],[y1, y2, …, yn]]

partition_max_orderfloat, optional

Order of the lattice partition used to find the quasi-lattice polygon that approximates polygon. Default is 16.

Returns:
List of List

List containing the rectangles points. Return all rectangles found. List is in the form: [[[x1, y1],[x2, y2],…],[[x1, y1],[x2, y2],…],…].