I'm looking for an algorithm that is closely related to the 2-dimensional nesting problem (also known as lay planning, bin packing, and the cutting stock problem).
The main differences between this and normal nesting are:
- A fixed number of elements to be placed
- The elements cannot rotate
- The elements must be placed in as small an area as possible, as opposed to placing as many pieces as possible in a fixed-size area.
- The elements are rectangular pieces with 0-4 fixed-orientation rectangular corner cutouts (“Utah-like”), as opposed to being randomly shaped
Input: n
“Utah-like”, fixed-orientation polygons. n
is in the range 1-20. The figures are not shaped to align perfectly with each other. Example figure set:
Desired output: A fixed-orientation nesting for a scaleable area with predefined proportions. The scaleable area should be scaled to fit the nested figures as snugly as possible, like so:
Note the area where the figures' rectangular boundaries overlap, preventing this from being a more trivial rectangle-packing problem.
I have perused several packing questions on SE (e.g. 1, 2, 3) as well as puzzle-solving questions (e.g. 1, 2, 3), and also outside Stack Exchange (1, 2, 3), but they don't describe this particular problem or don't include source code. Related GitHub repos: 1, 2, 3. Online solvers: SVGnest.com and Nestable.xyz.