Pack rectangles into an array of rectangles. For creating texture atlases.