[Math] How many rectangles or squares of (fixed and equal sizes) can fit inside a square of fixed size 320 x 320

packing-problem

Our factory creates graphite sheets. Their machine can only create sheet of one fixed size which is 320 x 320 mm (0.1240 sqm.).

Clients come to us with requests for different sheet sizes, all either square or rectangular in shape. Visually it's easy to judge how many 320 x 320 sheets I would need to use to fulfill the customer demand, but I can't figure out a formula to get this done automatically.

e.g.

A) For a client needing 160 x 160 mm (0.256 sqm) sheet size, visually it's easy to see that I can cut four pieces from each sheet, and nothing goes to waste.

B) Now for a client who needs 161 x 161 mm (0.259 sqm) sheet size, it's obvious that only 1 sheet can fit in a 320 x 320 mm sheet, with nearly 50% going to waste.

So basically I need the following :

In MS Excel e.g. if I could input the "length" and "width" of the customer's sheet size, I want to know how many pcs of that size can I cut out of a single "320 x 320" sheet.

Thanks in advance,
Cheers!

Best Answer

Nesting rectangles/squares into rectangular sheets

Optimal nesting and practical limits: When considering different nesting options while searching for an optimal nesting solution, it is desirable to find the solution quickly. This begs the question: how do I know a solution is optimal? The answer is not always obvious.

An automated nesting search is part of the answer, which can explore a number of options quickly, automatically and report the results: finding the maximum number of parts in a full sheet or finding the smallest sized sheet required for a given number of parts.

The spacing between the rectangles/squares and the spacing to the edges has been left undefined in your problem. For real-life problems the spacing is non-zero. For Laser-cutting the kerf (width of cut) is generally 0.3mm. In addition, generally in that industry 5mm spacing is used perhaps less. That said, I have assumed zero spacing as per your question. A mixture of rotations is assumed: either 0 degrees or 90 degrees. It is unstated if the material is cut with a guillotine which would limit the arrangements possible. Non-guillotine cutting is assumed.

Note that no single nesting method gives the optimum yield for nesting every size rectangle into every sized sheet.

The optimum nesting method varies depending on the rectangle sizes and sheet dimensions. Hence a simple formula approach is not appropriate.

Rectangle Packing Software

This rectangle packing software calculates and compares five different packing methods and highlights the most efficient solutions. The user can highlight each nesting variation to dynamically compare sheet options and mixed rotations. The software actually explores many more options than this but only displays the maximum number for each type of nesting.

It can be an advantage to have a working knowledge of these expected packing efficiencies of typical cases. (See efficiency graph)

Rectangular nesting search options

Rectangular nesting search options: In early versions of this rectangular nesting software it was assumed the optimum rectangular nesting would be found by simply checking 0 vs 90 degree packing with perhaps one (1) extra row rotated 90 degrees (Example A or B). When re-writing the software, instances were noticed where true optimum packing would require a different search (Example D) using Diophantine Equations. Additionally, arrays of four rectangles in square sub-nests can be optimal in some instances (Example E).

Graphing the packing efficiency vs rectangle dimensions into a rectangular plate

Using the rectangular packing software, the best packing efficiencies of each sized rectangle into a standard sheet size can be graphed.

Nesting efficiency 1 Nesting efficiency 2

The nesting efficiency of rectangles packed into a rectangular sheet (3000x1500mm) (2 views of the same 3D graph). Note the general non-linear nature with 80-90% efficiency, small local peaks of 90-100% efficiency and pits of lower efficiency <80%.

Hence, when designing products, high efficiency material use could be achieved if the part sizes are within these local peaks.

Using these results in a practical sense helps halt the search with confidence if adding another rectangle (N+1) would require an efficiency that, by the graph, is not possible. Optimal packing algorithms for rectangles in rectangles is continually being researched and improved.

Packing efficiency of Rectangles into a 320x320mm sheet

From the 3D Packing efficiency graph it can be seen how non-uniform the efficiency is and hence how unlikely a simple formula is.

I have included a .CSV EXCEL table here, with data generated from the above software, noting the maximum number of rectangles from a 320x320mm sheet for each part length and width.

.CSV file link

Of course the actual arrangement of each optimal solution is not included in the spreadsheet but is displayed by the software.

McErlean, P. (2018) "The CAD/CNC Programming Handbook: 2D Material Optimization and Tips for Laser, Plasma and Oxy profile cutting"