rectangle layout algorithm?

Terry Reedy tjreedy at udel.edu
Thu May 6 09:59:45 EDT 2004


"Richard Taylor" <rjt-usenet at thegrindstone.me.uk> wrote in message
news:409a0c8d$0$31702$fa0fcedb at lovejoy.zen.co.uk...
> Hi
>
> I need an algorithm to layout a collection of rectangles (images) within
a
> bounding rectangle (sheet of paper).
> ...
> (Actually building the composite image is not a problem, I am going to
use
> PIL to do that. It is knowing where to place the images that I need to
> solve.)

Among other things, the algorithm you want depends on the following:
Are the rectangles all the same size or different sizes?
Do you want to pack as tightly as possible or spread out over a background?
Are the images ordered or may they be placed randomly?
What is your criterion for a good versus poor layout?

Terry J. Reedy








More information about the Python-list mailing list