“What drove you to make this?”

“…I’m a nerd.”

When I showed the Polyhedra Viewer to my parents the first time, they reminded me that I used to spend hours on a whiteboard as a kid trying to calculate the volume of a tetrahedron and other geometric shapes. I remember in high school spending hours poring over Wikipedia articles for the different solids, looking at the links for websites of random geometry enthusiasts that were dated even ten years ago. I made cubes and icosahedra out of index cards and created polyhedral compounds out of origami.

compound of five tetrahedra

I’m drawn to discrete, finite collections of objects. In high school, I memorized all the elements of the periodic table for a Sporcle quiz and kept up to date with each new one discovered. I made the first version of my polyomino visualization in high school by hand, tracing out lines in an Excel spreadsheet. I even assigned characters to constellations and designed a Fire Emblem-like game out of them. There is beauty in structure, in patterns and relationships that straddle the line between ordered and chaotic.

It’s a strange hobby, one that I’ve never been able to fully explain to people. Even I myself don’t fully know why certain things catch my interest. For much of my life I thought it was weird to have such interests, and I was ashamed. “Normal people aren’t obsessed with geometric shapes,” I’d think to myself. Other times, I would think that if I found to get people to understand their beauty as well, it would validate me and prove that I’m not “abnormal”, whatever that word means.

Polyhedral Purity

Polyhedra, in particular, were special. In my framing of the world, mathematical objects were the “purest” collections. New ones didn’t come out every few years because of money, like Pokémon. There isn’t the possibility of finding new ones and having to update all the textbooks, like the periodic table. They are invariant and eternal, the inevitable result of simple geometric definitions.

table of Johnson solids

The Johnson solids fascinated me because they had this property I valued of being not-completely-orderly and not-completely-chaotic. The majority of them can be constructed in a rigorous, orderly fashion and put in an organized table, but some like the gyrobifastigium relied are unique constructions that are the only ones in their “rows”, while others, like the sphenocorona, are completely unrelated to any of the others! Even in the “orderly” rows you can somehow end up creating Archimedean and Platonic solids putting together the right combinations of operators. Like a certain HBO fantasy series, these were characters with deep and complex relations.

I also have a sillier reason for liking this set of polyhedra, bordering on the realm of numerology. The summer after my junior year, I had an “epiphany” and noticed that the Johnson solids can all be made from faces of 3, 4, 5, 6, 8, and 10 sides. If you take the prisms and antiprisms of those sides, the ones that are used to make the Johnson solids, you have 5 + 13 + 92 + 10 = 120 solids. It just happens that 120 is least common multiple of 3, 4, 5, 6, 8, 10. I’m pretty sure that it’s just a coincidence and there’s nothing mathematically valid about it, but when I discovered that fact, my love for polyhedra turned from the realm of mathematical curiosity and into the realm of the divine. I needed to show their beauty to the world.

Fantastic Detour

My first attempt wasn’t even to create an interactive app or any direct educational tool. It was a story. I loved anime and fantasy JRPGs like Final Fantasy and webcomics, so I wanted to make my own. I started worldbuilding, assigning classical elements to the Archimedean solids like Plato did to the Platonic solids. I came with a system of magic, names, locations, an entire cosmology based around mathemagics and and characters designed and coded after polyhedra.

Some sketches from the polyhedra comic

I soon realized, however, that creating a comic or game or whatever with 120 unique characters was way too much for any one person, especially someone with no formal game design, writing, or art experience. The cast shrunk to 13, and then 5. I reasoned the Johnson solids were too obscure, and cut them out of the cosmology I had created. The idea has shifted over the years, and is still shifting. I even managed to write a draft of it for National Novel Writing Month last November! It’s very much a concept I still want to do, if I can get a hang of actually writing and drawing regularly. But the concept had moved too far away, and I needed something else to satisfy my polyhedra obsessions.

Prior Work

I finally got the chance to create something related to polyhedra and Johnson solids the year after I graduated. I was depressed and frustrated with my job and not being able to do any front-end engineering. The closest I got was my manager assigning me to work on Jenkins because “it has a UI”. I decided to quench my thirst by working on polyhedra.

For my first attempt, I used the tools I knew how to use: D3 and Bootstrap. I found a library called X3DOM which lets you treat 3D properties like SVG, which interfaced well with D3 (and as I found out later, React). I made a parser that converted VRML files I found from George W. Hart’s Polyhedra Pages to JSON that I could use easier. I showed it to a couple of friends and moved on.

First polyhedra viewer in D3

Fast forward to a couple of years: I had been fired, spent a few months in sabbatical (including trying and failing to start my fantasy comic), and got a new job. I was yet again depressed and anxious and overworked, isolated and unsure of myself, but at least I finally got to work on front-end! We were about to start moving our front-end to React, and I was still paranoid from my last job that I was going to get fired again if I wasn’t a good little employee and did some self study. I needed a project to learn React, so what else do I turn to but the Polyhedra Viewer?

I had learned a few UI tricks from actually working on frontend code, so no Bootstrap this time. I created a new index page, and, because the company was planning to use Redux, added some sweet state-management features like configuration and filtering. It wasn’t mobile friendly or accessible and was meant more for me to learn a new framework. I showed it to a few friends and coworkers, and again called it a day.

Transitions

The keen reader may notice a pattern in when I end up working on the project: depression, anxiety, and a deep sense of unease in my life. As I mentioned, I was ashamed about my interests and, whenever I wasn’t depressed, tried to direct it towards other projects that I thought society seemed “acceptable” (like that ‘machine learning’ thing all the kids talked about). It was only when I was at my lowest that I would “regress” and fall back to hobbies and ideas that were comfortable to me.

In October 2017 I quit my job, absolutely exhausted. Two weeks later, I spent my 25th birthday curled up in a ball in my bed depressed, without any social support network, and completely unsure of who I was. I needed time to heal. I started taking anti-anxiety medication and decided to take a few months to really find a community that I felt like I belonged in. But getting better wasn’t a full time job, and I needed a project to keep me occupied. So what else do I turn to but my precious polyhedra?

The first thing I did was switch the index from a list view to a table view. The thing I didn’t like about the previous version was that the structure of the polyhedra’s relationships wasn’t apparent, and I wanted to think of ways to make that known. The table view was easy enough, and I created my new and improved “Periodic Table of Polyhedra” in about two weeks. But I kept thinking about structure and relationships.

sketches of the relationships between rhombicosidodecahedra

I was browsing through Wikipedia again and noticed a GIF of a cube expanding into a rhombicuboctahedron, then contracting into an octahedron. Maybe that would be cool: interactive animations showing the transitions between the Platonic, Archimedean, and Johnson solids. There were plenty of “polyhedra viewers”, but none that I knew of that had a deep catalog of transitions. I started mapping out the relationships between the polyhedra, how and what operations would transform one into the other, and what it would take to implement such complicated animations. Maybe that would finally sate my obsession for a polyhedral “collection”. And maybe, just maybe, it would finally show the world the beauty that I saw in these shapes. So I started working.

In the next section, I’ll go over the inspirations and struggles in making the Polyhedra Viewer clean and usable.

Part of a series of blog posts about the creation of the Polyhedra Viewer.