Polycube Box Fitter

1. Set the box
2. Choose the pieces

How to Use the Fitter

A polycube is a solid made by gluing unit cubes together face to face, and a set of them that exactly fills a box is the basis of almost every 3D packing puzzle on a shelf. If you want the definition properly, the Soma cube explained guide takes it apart. This page is the working version: pick a box, add pieces, and find out whether they go in.

  • The cell count has to match exactly. Twenty seven cells of pieces for a 3x3x3 box. The button stays off until it does.
  • Boxes up to 64 cells. Any shape, from 1x2x3 up to 4x4x4 or the long 2x2x8.
  • Answers come back as layers. Each grid is one horizontal slice seen from above, so layer 1 is the bottom of the box. Build it bottom up and the labels tell you which piece goes where.
  • Pieces may be turned any way at all, but never mirrored. That is how real puzzle pieces behave, and it is why the two screws are listed separately.
  • Impossible is a claim, not a shrug. The fitter says a box cannot be filled only when it has proved it. If it runs out of time instead, it says that.

The Ten Pieces

Two tricubes, the straight bar and the L. Then all eight tetracubes: bar, square, L, T, S, tripod, and the two screws. That is every shape you can make from three or four cubes, and between them they build the classic box puzzles.

The two screws are the ones worth looking at twice. They are mirror images of each other, and no amount of turning will convert one into the other, so a puzzle that includes both behaves differently from one that includes the same screw twice. The Soma set contains exactly one of each, which is why a Soma solution reflected in a mirror is still a Soma solution.

Challenges Worth Trying

The presets load the classics. The solution counts below come from enumerating every filling exhaustively, not from a reference table, and they all use one convention: rotations of the whole box count as the same filling, mirror images count as different.

  • The Soma cube. One L tricube and six of the tetracubes in a 3x3x3 box. 480 fillings. The figure usually quoted is 240, which additionally treats a filling and its mirror image as one and the same, and 11,520 is the same set counted with every rotation kept separate. Piet Hein came up with it in 1933, during a lecture on quantum mechanics given by Werner Heisenberg. For the figures beyond the box, the Soma cube shapes tool builds twelve other shapes from the same seven pieces.
  • All eight tetracubes in a flat box. Thirty two cells, so 2x4x4, and 1,390 ways to do it. Forgiving enough to hand to someone new.
  • All eight tetracubes in a long box. The same eight pieces and the same thirty two cells in 2x2x8, and only 224 ways. Six times tighter than the flat box, from nothing but the shape of the container.
  • Nine L tricubes in a cube. Nine copies of one simple piece filling 3x3x3, 222 ways. The uniformity is what makes it hard, because there is nothing distinctive to anchor on.
  • Nine straight tricubes in a cube. The same box, nine plain bars, and just 3 fillings. Of everything here this is the one where knowing the count helps least and finding one helps most.
  • Sixteen tetracubes in 4x4x4. Two of each, and the largest thing the fitter will take on. It still lands in well under a second.

Why Some Boxes Are Impossible

Ask for two straight bars, two squares, two Ls, two Ts, two Ss, one screw and one tripod in a 3x4x4 box. Twelve pieces of four cells into forty eight, so the arithmetic is perfect, and yet there is no filling. The fitter says so instantly, without searching at all, and the reason is worth knowing because you can use it yourself at the table.

Colour the cells of the box like a 3D chessboard, so every cell touching a black one is white. In a box with any even dimension the two colours come out exactly equal. Now look at what one piece covers. The straight bar always sits on two black and two white, whichever way you turn it. So do the square, the L, the S and both screws. The T and the tripod never do. They always cover three of one colour and one of the other, and turning them only decides which colour gets the three.

So a filling has to balance. If the box needs the colours equal, the pieces that throw the count off have to cancel each other out, and three such pieces can never cancel to zero. Two Ts and a tripod is three of them. No arrangement exists, and no search is needed to know it. Swap that tripod for the second screw and the same box fills without trouble, which you can try in the fitter in about ten seconds.

The test only runs one way, though. Passing it does not promise a solution, it just fails to rule one out. When a box passes, the fitter has to go and look, and for a small number of awkward shapes it can run out of time without settling the question. It says so rather than claiming the box is impossible.

Where the Fitter Stops

The piece list ends at four cubes, which leaves out the best known polycube puzzle of all. The Bedlam cube is thirteen pieces filling a 4x4x4 box, twelve of them pentacubes, and at 19,186 solutions it is a harder search than anything here by a wide margin. Flat polycubes have their own tool: the pentominoes guide covers the five-cell shapes in two dimensions, and the pentomino solver will place them for you.

Puzzles Built From Polycubes

Everything above is theory you can hold. Cube Alchemy is the direct version of this tool in plastic: one set of polycube pieces, 180 printed challenges, and a box to fill. Soma Flop is the Soma set with a twist in how the box closes, and Ochinai Soma runs two puzzles through the same seven pieces, where the second goal is that nothing falls out of the bottom.

For the wider shelf, the 3D packing puzzles collection is where the box fillers live, Soma cube puzzles narrows it to the classic seven, and mechanical puzzles is the full catalogue. If you came here for the solver rather than the shelf, the puzzle tools page has the rest of them, including the pentomino solver for the flat version of the same problem and the snake cube solver for the chain of cubes that folds into one.