Sign in to follow this  

Distributing Rectangles in a 2D Canvas

This topic is 2660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,
I need to distribute axis-parallel rectangles with different widths and heights on a 2-dimensional canvas. The requirements are:
1. None of the rectangles may intersect with another rectangle, nor be placed beyond the canvas, i.e., the rectangles are bounded by the canvas;
2. Distribute as many rectangles as possible, i.e., minimize `free' space that are not occupied by any rectangles.
So my problem is to find an algorithm that computes the positions of the rectangles given the widths and heights of the rectangles and the canvas. I'm thinking about linear programming here, but just can't get my head around it.
Any suggestion and/or direction is appreciated. =)

Share this post


Link to post
Share on other sites
'Bin packing' is the term you're looking for. There are lots of references available on this, so try searching the forums and/or internet for (e.g.) 'bin packing', 'texture atlas', or 'lightmap packing'.

Share this post


Link to post
Share on other sites

This topic is 2660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this