Alex Rivera | Logout

Finding an axis-aligned rectangle inside a polygon

Asked 2009-03-04T13:06:10.177
23

I am looking for a good algorithm to find an axis-aligned rectangle inside a (not necessarily convex) polygon. A maximal rectangle would be nice, but is not necessary - any algorithm that can find a "fairly good" rectangle would be fine.

The polygon may also have holes, but any pointers to algorithms that only work for convex or simple polygons would be helpful too.

In my implementation, intersection testing for sides is fairly cheap, but "point in polygon" tests are expensive, so ideally should be minimised.

Edit
Report

1 Answer

0

What about using ear clipping? You could find the maximum axis-aligned rectangle in each triangle. Then you could try to join triangles and recompute your rectangles.

answered 2012-04-30T13:53:45.880

Your Answer