# Many-to-many Shape Sorter

Did you like playing with shape sorters as a toddler, but find them too simple as an adult? Well, I’ve got good news for you.

It started at February’s MathsJam, when the folk from East Dorset set a challenge for MathsJams around the world. They provided an example of an object that would cast a circular shadow from above, a square shadow from the front and a triangular shadow from the side. Could we, they asked, design objects that would cast a different set of shadows? Circle, circle, square maybe? Or circle, square, hexagon?

In Canterbury, we puzzled over this for a while. Circle, triangle, triangle was solved quickly, but circle, circle, square had us stumped. There was lots of hand waving and sketchy drawings. We could all see the shape, and I’m pretty sure we were all seeing the same thing, but none of us could define it in a tangible way. Until somebody said ‘it’s like the intersection of two drainpipes’.

That didn’t help us to draw the object, but it did mean that when I got home I could model it with OpenSCAD, which is perfect for jobs like this. With only six lines of code (two of which were closing braces) I had an onscreen model of the intersection of two cylinders, and a few hours later I had 3D printed it and could verify that, yes, it did cast a square shadow from above and circular shadows from the front and side.

intersection() {    cylinder(2*radius,radius,radius,center=true);        rotate([90,0,0]) {            cylinder(2*radius,radius,radius,center=true);    }}

I’ve since found out that this is called a Steinmetz solid; if you want to know more about them, Evelyn Lamb has written an interesting article.

But why stop there?

If circle, circle, square was the intersection of two cylinders, then maybe circle, square, hexagon would be the intersection of a cylinder and a hexagonal prism – and so it was. Well, almost. I couldn’t get both a square and a regular hexagon with perpendicular shadows; I had to settle for either a non-square rectangle or an irregular hexagon, but I counted that as a success. Soon I had a happy little family of objects that each cast its own set of shadows.

It still didn’t feel like enough, though. It’s hard to get a perfect shadow without fingers getting in the way and I wanted an easy way to show off the views of the objects. Another few hours with the 3D printer and I had it – the many-to-many shape sorter. Each object fits snugly through at least two holes, and each hole will accept one or more objects. Now I can show my shapes off as much as I like. There’s something immensely satisfying about seeing an object that doesn’t look at all hexagonal fitting neatly through a hexagonal hole.

If you would like to print your own many-to-many shape sorter, the files are all available on Thingiverse. Or why not play with OpenSCAD and see what other combinations you can create? You don’t need a 3D printer to use the software (which is free) – the objects can be rendered onscreen and you can rotate them to see the different views.Your inner toddler will love you for it.

## About the author

• #### Sam Hartburn

Sam is a freelance proofreader and copy-editor who enjoys working on all kinds of maths books.

### 6 Responses to “Many-to-many Shape Sorter”

1. Barney Maunder-Taylor

Wow Sam I really enjoyed reading this post: being the maths-jammer from East Dorset who wrote the February Shout Sheet, I’ve been delighted to see the puzzle was enjoyed worldwide! The original shape was not mine: I found an artist’s impression of the triangle-square-circle shape in a book that may have been a Gardner or a Hofstadter some time ago, wish I could remember which. The solid pictured in the Shout Sheet was my cardboard-and-paint homemade version, wish I had your talents to be able to make your great selection. Anyway, it sparked an interesting conversation at East Dorset about what other shapes are possible, which is how the puzzle then ended up on the Shout Sheet.

Incidentally, the picture on the front cover of Hofstadter’s “Godel Escher Bach” (1999 version) features an object casting shadows of the letters G, E and B from three perpendicular directions. I read somewhere that, in theory, you could make a “digital sundial” whose shadow at any moment is the correct digital time.

Colin Beveridge alerted me to this post, and also designed the net of my shape – the link appeared on the Shout Sheet. Great work on the 3D printed shapes, Sam, they are fab, hope I get to meet you in person and play with them some day!!

2. Zeno Rogue

There are many other cool objects which cast different shadows from different directions. I remember an article in Scientific American about a digital sundial, showing the time in digital format (IIRC this was a mathematical construction, not realistic at all). Realistically, there is e.g. this work which shows all the four members of the Beatles when looked at from different directions. This one made of Lego is nice too.

3. Andrew Stacey

Here’s a link to an OpenSCAD file with a proposal for a shape with cross sections of a square, a circle, and a hexagon. Christian has 3D-printed it and confirmed that it works, see this post on twitter.

There are two ideas behind it. For concreteness, let’s assume that we see the hexagon from above, the circle and square from the sides. Let’s say that the object’s width can be seen from the circle direction and the length from the square direction.

1. Diameters. The post is all about the projections of a 3D object. Dropping down a dimension, we can consider the orthogonal projections of a 2D object. These will just be line segments, so all that is interesting about them is their length. We’ll call this length a diameter of the shape in the given direction. This agrees with the standard diameter when applied to a circle.

Now consider looking at the shape from the circle direction. The width and height of the shape must both be the diameter of the circle. From the square direction, it’s a little less obvious but any two orthogonal diameters are the same so we deduce that the length and height must also be the same. This means that from the hexagon’s direction, the width and length of the shape must be the same. If the hexagon is oriented in either of its usual ways, this isn’t true. We therefore need to rotate the hexagon so that its width and length are the same. This means we have to rotate it by 15 degrees. That sets the hexagon.

(Incidentally, there’s a nice application of the Intermediate Value Theorem which says that any connected shape will have two orthogonal diameters of the same length.)

2. Corners. If we consider starting with a cube and chopping stuff off it to get the projections we want, then the circle direction works by chopping off corners. The hexagon also has a tendency to remove stuff near the corners. This means that, particularly as we have to rotate the hexagon a bit, needing stuff near the corners becomes a bit of an ask. With the square in its usual orientation, this becomes too much and we can’t get the corners of the square. Fortunately, there’s no rhyme nor reason why the square has to be in its usual orientation and rotating it by 45 degrees means that it, too, wants the corners removed.

(It would be interesting to see what the minimal rotation of the cube should be, here.)

In conclusion, rotating both the square and hexagon by the right amount gives a shape that seems to work.