Printing Pictures on the Surface of Polyhedra

Designing a polyhedral model of a small panda

[go back to the main polyhedral pictures page]

My model of Amble the panda was the first picture I tried to draw on the surface of a dodecahedron. Generating the globe required no drawing, just software: it was a matter of stringing together a long line of mechanical data processing utilities (some of which I had to write myself) to convert some pre-supplied data into the right format. Amble, by contrast, required me to do actual graphic design and artwork.

Lacking any particularly sensible way to draw directly on the surface of a sphere, I decided the simplest approach would be to take advantage of the fact that Amble is mostly plain white, with only a few small black markings (paws, ears, tail, facial features). So I drew each of those markings separately in an ordinary Euclidean drawing package, and then projected each one on to the appropriate area of the spherical image.

The drawing package I picked was Dia, mostly because it was already conveniently available on my Debian system. Dia isn't really ideally suited to artwork of this type, being more designed for box-and-line diagrams, but it does have a general Bézier curve tool, so I just about coped. With hindsight, I might have tried Inkscape instead, but I hadn't heard of it at the time.

So I drew a number of small pictures in Dia, representing Amble's face, hand and ear, tail and foot.

Having done that, I then had to import those images into my spherical image mechanism. This involved writing a script which read the Dia file format and generated a fragment of PostScript I could feed to the projection engine I'd already written for the globe.

Dia's file format is gzipped XML. This made it fairly easy to read, since the nice thing about XML is that you don't have to understand the entire format in order to parse it basically successfully and extract just the bits you need. So I wrote a Python script which read in a Dia file and extracted the coordinates of all the lines, Bézier curves and so on, then projected them into spherical coordinates and converted them into PostScript.

One important part of this process was to flatten Bézier curves into sequences of straight lines. There's no particularly sensible definition of a Bézier curve on a sphere, and even if there were, it wouldn't be exactly the same as what you get from projecting the control points on to a plane and drawing the resulting curve. This wouldn't matter for a curve contained entirely within one face of the polyhedron, but if a curve crosses a face boundary then I needed to be sure the two halves would match up exactly at the boundary. Straight lines (or, more accurately, great circle arcs) do give this guarantee, since the gnomonic projection of a great circle is given by intersecting the solid with a plane passing through the origin and the line, and hence joins up correctly when the projection surface changes direction.

So my final artwork and processing framework for the Amble picture ended up consisting of several Dia files, and a Python script; that script, as well as containing the general code to convert Dia into spherical-image data, also contains the Amble-specific information about what Dia files exist and what parts of the sphere to project them on to. (Some of the above pictures were projected twice on to opposite sides of the sphere, once in mirror image. This saved me having to draw each paw and ear twice by hand.)

This was a thoroughly ad-hoc way to do anything, but it worked well enough, and in fact it worked well enough that I was able to adapt the same technique to my subsequent models of a badger and Eek! the bat.


Here's the PDF net of Amble.

[go back to the main polyhedral pictures page]

(comments to
(thanks to chiark for hosting this page)
(last modified on Sun May 7 14:33:22 2017)