PLANNING WORKSHEETS

Checking gaps between pieces in a rectangular grid

When rectangular pieces are laid in a grid on a sheet, gaps appear only between neighboring pieces, and margins appear only at the outer edges. This guide shows the fit formula, a default case and a second layout where rotating the piece adds one.

The layout problem

Cutting, printing and punching jobs often ask how many identical rectangles fit on a larger rectangular sheet. The pieces need a margin at the sheet edge and some spacing between them, for the saw kerf, the trim or a safety allowance. The Rectangular Sheet Grid Calculator takes the sheet width and height, the piece width and height, one margin applied to all four edges and one gap between neighboring pieces. It counts how many columns and rows fit, and multiplies them to get the pieces. It tests a simple axis-aligned grid in the orientation you enter. This guide explains why the gap appears one fewer time than the number of pieces in a row, and how that detail changes the count compared with a naive division.

Gaps exist only between pieces

A row of three pieces has two spaces between neighbors, not three. The gap is a separator, and there is nothing to separate on the outside of the first or last piece, where the margin takes over. The occupied width of a row of n pieces is n times the piece width plus n minus 1 times the gap. In the default case, three pieces of width 28 and two gaps of 3 occupy 84 plus 6, which is 90. If the calculation wrongly included three gaps, the row would seem to need 93, and a layout that actually fits would be rejected. This is the same fence-post counting as in many planning problems: n posts need n minus 1 gaps between them.

The column formula

The calculator finds the number of columns as the floor of the usable width plus one gap, divided by the piece width plus one gap. The sheet width is 100 and the margin is 5 on each side, so the usable width is 100 minus 10, which is 90. Adding one gap of 3 gives 93, and the piece width plus a gap is 31. Dividing 93 by 31 gives exactly 3, so there are 3 columns. The extra gap in the numerator is a trick that accounts for n minus 1 gaps: if n pieces and n minus 1 gaps fit in the usable width W, then n times p plus n minus 1 times g is at most W, which rearranges to n at most W plus g, divided by p plus g. That is the formula.

The row formula and the default result

The same logic runs vertically. The sheet height is 50, so the usable height is 50 minus 10, which is 40. Adding a gap of 3 gives 43, and the piece height plus a gap is 40 plus 3, which is 43. The quotient is exactly 1, so there is 1 row. The piece height of 40 equals the usable height exactly, a perfect fit with nothing to spare. The number of pieces is 3 columns times 1 row, which is 3. The calculator returns these three values for the default inputs. The Basic Calculator confirms the width: 3 times 28 is 84, and 84 plus 6 is 90, matching the usable width exactly. Both directions fit with no leftover, which is rare in practice.

A second layout with spare space

Take a sheet of 120 by 90, pieces of 20 by 25, a margin of 10 and a gap of 2, all in the same unit. The usable width is 120 minus 20, or 100, and the columns are the floor of 102 divided by 22, which is the floor of 4.64, giving 4. The usable height is 90 minus 20, or 70, and the rows are the floor of 72 divided by 27, which is the floor of 2.67, giving 2. The grid holds 4 times 2, which is 8 pieces. The four columns occupy 4 times 20 plus 3 times 2, which is 86, leaving 14 of spare width. The two rows occupy 2 times 25 plus 2, which is 52, leaving 18 of spare height. The leftover space is too narrow for another piece in either direction.

Rotating the piece

The calculator tests the orientation you enter, so rotating the piece is a second run with width and height swapped. Using the same sheet, margin and gap, with pieces now 25 wide and 20 tall, the columns are the floor of 102 divided by 27, which is 3.78, giving 3. The rows are the floor of 72 divided by 22, which is 3.27, giving 3. The grid now holds 9 pieces, one more than before. Rotation helped because the 20 side fits three times along the 70 height with 72 divided by 22 leaving room, whereas the 25 side fit only twice. Always try both orientations. The tool does not rotate automatically, and a mixed layout that uses both orientations could do better still, but that is outside this calculation.

Choosing margin and gap values

The margin and the gap are not the same thing and should not be treated as one number. A margin is the unusable border of the sheet: a printer's non-printable edge, the clamped strip of a cutting machine or an uneven factory edge. A gap is the spacing between adjacent pieces, which absorbs the kerf of the blade, the width of a score line or a safety allowance. A saw blade removes material equal to its kerf, often a few millimeters for woodworking tools, and that amount belongs in the gap. Enter real allowances from your process. The calculator treats a zero gap as pieces touching, which is acceptable only if no cutting width is lost. Using hypothetical small allowances as if they were specifications can leave you with pieces that do not fit. A practical tip is to measure the gap by cutting a test piece, not by looking up the blade specification. Cut two pieces from scrap, measure the combined width, and compare it with the sum of the intended widths. The difference is the actual material lost per cut, and it is the number to enter as the gap. Repeat when the blade is changed or sharpened, because the kerf varies with the blade and the material.

Vertical and horizontal fit are independent

The width calculation determines the number of columns and the height calculation determines the rows, and the two are independent. A layout can have plenty of room in one direction and none in the other. In the default case, three columns fit with no spare width, but only one row fits, so the sheet yields 3 pieces. If the height were 53 instead of 50, the usable height would be 43 and the rows would be the floor of 46 divided by 43, which is still 1, and a second row would need a usable height of 83, since two rows of 40 plus one gap of 3 come to 83. A valid row does not guarantee that a second row fits. Check both directions separately, and remember that the pieces count is only as good as the weaker direction.

What the grid does not model

The tool does not model cutting sequences, such as guillotine cuts that must run edge to edge, irregular nesting of shapes, grain or print direction, or the tolerance of the equipment. Real cutting often needs a trim cut on the first edge, which can be added to the margin. If the pieces have rounded corners or are not rectangles, the bounding rectangle is what you enter, and a tighter packing may be possible with specialized software. The grid also assumes every piece is identical. For mixed sizes, run separate layouts or use a nesting tool. The result is a quick, conservative estimate of what an axis-aligned grid can hold, useful for deciding whether a sheet size is plausible before detailed planning. If the result comes out just short of what you need, there are a few honest options. Reduce the margin if the equipment allows it, shrink the gap by using a thinner blade, rotate the piece, or choose a slightly larger sheet. Each option is a change to one input, so the calculator can compare them within a minute. Record the settings behind the layout that you finally choose, so the same job can be repeated later.

Checking a result by hand

A simple audit replaces the formula with a direct sum. For n pieces in a row, the span used is n times the piece size plus n minus 1 times the gap, and it must not exceed the usable length, which is the sheet size minus twice the margin. The spare length is the usable length minus the span. For the default width, the span is 90 and the usable length is 90, so the spare length is zero. For the 120 by 90 layout, the width span is 86 against 100, a spare of 14, and the height span is 52 against 70, a spare of 18. If the spare length is at least one piece plus one gap, another piece should have fit, and the count is wrong or the formula was misread. It is a quick way to spot a typed value in the wrong field.

Pieces that do not fit at all

When the piece is wider than the usable width, the number of columns is zero, and so is the total. With a sheet width of 100, a margin of 5 and a gap of 3, a piece 95 wide cannot fit, because the usable width is only 90. The formula gives the floor of 93 divided by 98, which is zero. The calculator caps the count at zero with a maximum, so a negative number of columns never appears. A zero result means the piece must be smaller, the margin must shrink, or a larger sheet is needed. It also catches unit mistakes: a piece entered in centimeters on a sheet entered in millimeters will show up as many more pieces than expected, and the reverse will show none.

Reproduce the checks

Three-column grid

Open the Rectangular Sheet Grid Calculator and enter:

Sheet width
100
Sheet height
50
Piece width including bleed
28
Piece height including bleed
40
Margin on each edge
5
Inter-piece gap
3

Expected output:

Columns

3

Rows

1

Pieces per sheet

3

Two internal gaps fit the three pieces.

Piece widths

Open the Basic calculator and enter:

First number
3
Operation
multiply
Second number
28

Expected output:

Result

84

Only the pieces contribute to this subtotal.

Pieces plus internal gaps

Open the Basic calculator and enter:

First number
84
Operation
add
Second number
6

Expected output:

Result

90

The occupied width equals the usable width.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks