GitHunt
AV

avaneev/areafitter

Fit Multiple Smaller Rectangles Into Larger Rectangles or Images - Iterative Permutational Optimization Method

areafitter

Rectangle Area Fitter, Fit Multiple Rectangle Areas Into Several Larger
Rectangles

This algorithm can optimally fit a number of small rectangles into one or more
larger rectangles. The algorithm works iteratively for the specified number
of iterations. The algorithm was designed in a way to provide a better fit at
the initial iterations, further iterations usually improve the result by a
small margin only.

You can specify rectangle width, height and area constraints.

See the example.cpp file for a basic usage example.

Contributors

MIT License
Created December 18, 2016
Updated October 9, 2025