Skip to content

Ababwa/packer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Attempts to pack rectangles into as small and square a space as possible by packing two opposing corners.

Works as follows:

  1. Sort rectangles by descending perimeter.
  2. Alternate between placing each rectangle in the "top-left" and "bottom-right" corners of an indeterminately sized rectangular region.
  3. Place each rectangle as close to the corner as possible (e.g. as "up" and "to the left" as possible).
  4. "Glue" each corner together, determining the final rectangular region and rectangle coordinates.

Performs poorly when there is a small number of rectangles with a large variance in size. Does not rotate rectangles.

For a general-use rectangle packer, use Kryptan's rect-packer.

About

Packs rectangles into opposing corners

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages