Used to approximate a polygon with rectangles - a process known as rectangular decomposition. This algorithm starts by computing the largest inscribed rectangle within a convex hull. Rectangles are generated around the inscribed rectangle which provides the general shape of the polygon.
For best results, this function can be called iteratively by clipping the source polygon with rectangles generated by the getOverlappingRectangles() method and feeding the clipped polygons into new instances of this class.
- Daniel Sud for the Inscribed Rectangle algorithm
- Project Nayuki for the Convex Hull implementation
Instead of relying on an inscribed rectangle, break up polygon into convex regions using a library like Bayazit