Psellos
Contemporary Development With Functional Programming

Archimedean Solids in OCaml

October 13, 2012

One of the many ideas I have on the back burner is to apply “crowdsourcing” to the age-old question of whether the Platonic solids or the Archimedean solids are cooler. One day I’d like to make an OCaml iOS app that shows a pair of the different masters’ polyhedra and lets you vote on which is cooler.

Recently I was delighted to find that there’s a little OCaml library called Polydroml that calculates geometric information for nearly all the uniform polyhedra. It’s based on the Wythoff construction, which unifies all the different polyhedra through the single idea of tiling the surface of the sphere with spherical triangles.

Polydroml is the work of Fabian Pijcke and Pierre Hauweele. The current Polydroml code supports all but four of the Archimedean solids. I’m the kind of guy who likes to collect the whole set, so I spent a couple days adding support for two more polyhedra to the library.

The two I added are the great rhombicuboctahedron (shown in the figure) and the great rhombicosidodecahedron. They’re characterized by the fact that their vertices are located inside the spherical triangles of the Wythoff construction—not on their edges. As a result, they have more faces than the simpler polyhedra and hence are cooler. (But don’t let me influence your vote when the app comes out.)

I fear there aren’t many people working with polyhedra in OCaml, but maybe I’ll be pleasantly surprised. If you’re interested you can get Polydroml itself, my patch to Polydroml, or a version of Polydroml with my patch already applied, at the following links:

(For convenience I’ve repackaged Polydroml as a zipfile—see the library link above for information on the official release. I have no relationship to the authors of Polydroml, other than that I think they must be pretty cool.)

The final two unimplemented Archimedean solids are so-called “snub” forms, which are possibly the coolest of all the convex uniform polyhedra (just my opinion—not an official endorsement). I’m hoping to add support for them pretty soon, after some further study of the Wythoff construction.

I enjoyed learning some spherical geometry while working on this:

  • A spherical triangle is determined by its three angles (no similar triangles on the sphere).

  • Spherical lines (great circles) intersect in two points!

  • Need to do constructions on the surface of the sphere, not in the plane of your triangle!

It gives me newfound respect for Archimedes, who somehow figured it all out while relaxing in the bath.

If you have comments or questions, please leave them below, or email me at jeffsco@psellos.com.

Posted by: Jeffrey

Comments

blog comments powered by Disqus