Skip to main content
Open

Find Largest Internal Rectangle from a Polygon

Related products:Transformers
  • Oct 14, 2019 12:00 AM UTC
  • 3 replies
  • 162 views

milo89
Enthusiast
Forum|alt.badge.img+26

Looking for a transformer to establishing the largest rectangle that would fit inside a given polygon. The mathematics behind it is extremely complex, though would be happy if it only worked with convex polygons to simply things.

This idea isn't exactly new.
Previously raised in a few questions:
2015 - https://knowledge.safe.com/questions/4879/maximal-rectangle.html
2018 - https://knowledge.safe.com/questions/65011/maximum-inside-rectangle-from-an-polygon.html

However, I don't believe it has been raised as an idea yet.

3 replies

jdh
Contributor
Forum|alt.badge.img+41
  • Contributor
  • Oct 15, 2019 8:08 PM UTC

milo89
Enthusiast
Forum|alt.badge.img+26
  • Author
  • Enthusiast
  • Oct 20, 2019 10:33 PM UTC

Thanks @jdh

I've seen that article and the code that has been used. I'm not sure if my implementation is correct but I've found instances where rectangles provided could potentially be extended further and still fit within the polygon.


jdh
Contributor
Forum|alt.badge.img+41
  • Contributor
  • Oct 21, 2019 5:19 PM UTC

Your implementation is probably correct. The algorithm is an approximation, and doesn't guarantee the largest possible polygon, just one that is close to it.