Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7930293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:22:40+00:00 2026-06-03T20:22:40+00:00

I have a (not necessarily convex) polygon. I’d like to find a set of

  • 0

I have a (not necessarily convex) polygon. I’d like to find a set of rectangles that take up all space in the world bounds ((0,0) to (100,100)) without taking up any space inside the polygon. What’s the easiest way to find these polygons? Are there algorithms for this sort of thing?

Thanks!

For example, the polygon

 __    __
|  |__|  |
|________|

could be broken in to the following five rectangles:

aaabbbbbbbbbbeee
aaa|  |cc|  |eee
aaa|________|eee
aaaddddddddddeee

or, alternatively, the following six rectangles:

aaaaaaabbccccccc
eee|  |bb|  |ddd
eee|________|ddd
ffffffffffffffff

Is there an easy way to break a polygon into the rectangles between the polygon and the world boundaries?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:22:42+00:00Added an answer on June 3, 2026 at 8:22 pm

    All that I can glean: It’s possible but impractical (especially if your polygon has slanted lines). I don’t need this answer any more, but I guess that the algorithm would look something like the following:

    • Use triangles to make all edges of the polygon either vertical or horizontal
    • Use four rectangles to cut out as much space as you can on the top/bottom/left/right
      • Now you’re left with a polygon that has only vertical/horizontal edges and which extends to every border
    • Greedily place the biggest rectangle you can in the biggest holes in the shape
      • Look for the largest gaps between sides
    • Fill the triangles from step 1 up to a terminal precision
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to have a commit message cleanup that will not necessarily remove lines
I have this repository that I'd like to share but not necessarily by putting
Assume that we have two sets: A=(a_1,a_2,...,a_m) and B=(b_1,b_2,...,a_n) (Not necessarily of same size).
I do not necessarily have to use response.redirect, but that is what I had.
I have relationships that might not necessarily exist (they could be optional i.e. null);
I have a overridden UIGestureRecogniser designed to detect 2 touches, but not necessarily one
I have not had to do something like this in the past and am
It's likely that this is just a general Python Tkinter question, not necessarily a
I have a string that is one of the following forms ABC // all
I have a big list of points that define a boundary of some (not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.