Foam Cube Puzzle

After having solved the puzzle shown below a few times by combining six foam pieces to construct a hollow cube, I wondered if it had a unique solution. A simple brute-force search reveals it does. Source code: foam_cube.py

Foam Cube Puzzle
All six foam pieces.

As a first step I digitalized all pieces seen above. Having an internal representation, I wrote a script which tries all possible rotations and reflections (as three-dimensional rotations can imply two-dimensional reflection) to try and construct a three-dimensional cube from the given pieces. Using short-circuit evaluation to not bother with already impossible solutions, the search space is narrow enough to not require any considerable computing time. The resulting unique solution modulo rotation is shown above; the top face is placed on the bottom right.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.