I’m currently at MSRI at a knot homology meeting. There are lots of people here with pictures of surfaces, some of these even being categorical, so I thought I would return to the subject of computer manipulation of these. In particular I thought I would make use of our (hopefully) brief sojourn at WordPress and take the opportunity to embed some videos.

In my paper A diagrammatic approach to Hopf monads I had lots and lots of surface diagrams — these are the one-dimension higher version of string diagrams which can be useful for notating morphisms in monoidal 2-categories or 3-categories. So I had to draw a hundred or so pictures like this one.

[I hope to write something more about Hopf monads at the café at some point very soon.]

I drew all of these pictures in xfig — a standard 2-dimensional drawing package in which you have to do all of the 3-d stuff by eye and can’t do any fancy shading or anything. It would be really nice if I could actually create these as 3-d objects and then just export some projection of them, possibly suitably ray traced. I had an attempt at creating some categorical surfaces using blender, which is a splendid piece of open source software which you can use to make movies like Shrek or Monsters Inc. Here are two of my efforts.

The first represents the associator natural transformation in a monoidal category (see the Hopf monads paper linked above for the details).

The second is the so-called swallowtail relation (see Figure 25 on page 40 of HDA4).

As well making movies with such models you can also embed the 3d model in to pdf files and, provided you’re using acrobat😦 your readers can rotate the surface for themselves. Here’s an example from meshlab.

Whilst this is all well and good, there are at least two things I would like to be able to do that I currently can’t.

- Draw on the surfaces. I want to be able to draw what are essentially morphisms, like in the Hopf monad picture above, and also to be able to label them.
- Integrate with mathematics software such as sage or maple, or possibly even with some scripting language such a python. Then I wouldn’t have to input the surfaces with a mouse incredibly slowly in blender, but would be able to somehow code up the surfaces.

One thing to note is that these “surfaces” can be singular, as in the associator example above, so are not so easy to handle in standard packages with tend to expect non-singular things.

So, has anyone else tried using 3d software for modeling surface diagrams?

March 20, 2010 at 4:46 am |

You have

alwaysbeen able to embed YouTube videos. You just have to do itright.March 21, 2010 at 1:49 am |

I don’t know this is helpful or not, but one tool that you might use is MATLAB. One of the (in this case) advantages of MATLAB is that it has a relatively flexible visualisation framework which assumes that inputs are actually matrices defining a surface mesh (which it’ll interpolate in a reasonable non-problem specific way) which you generate separately (ie, to do parametric plotting you create the discrete mesh of samples yourself then get it displayed). This is an advantage because you can explicitly control what gets done in singular areas rather than relying on a parametric plotting programs built-in heuristics. The downside is that you’ll either have to come up with programmatic ways of generating the “sheets” of your surface or else import the mesh from some point and click tool. The visualisation part can do everything you want (lighting, captioning, animation, etc) except “automatically drawing on the surfaces”, but since the input is being provided as a mesh if you can figure out a some way of picking those mesh vertices through which you want your curves to go through, or which “mesh face” you want symbols on, you can draw them as separate objects so that they “appear” to be drawn on the surface.

A MATLAB licence is however probably very expensive just for drawing some diagrams. There’s GNU Octave which is an attempt at a FOSS implementation (using GNUPLOT as the visualisation backend) but I don’t know how much of the drawing facilities they’ve actually implemented. (I hold no brief for MATLAB: I think it’s horribly overused outside it’s “optimal domain” but this problem seems to be one where it’s a reasonably good fit.)

March 21, 2010 at 8:48 am |

Why does the swallowtail cobordism look sort of crinkly, as if it had been left out on the dashboard of your car on a hot day?

It almost seems as if the wrinkles move as the surface rotates, too!

I love the swallowtail cobordism so these things matter to me. My student Mike Stay is writing about compact monoidal bicategories, where the swallowtail plays a key role.

March 21, 2010 at 2:05 pm |

You seem to be more proficient with blender than I am, so I hesitate to say this, but it looks like maybe retopo might be the sort of thing you’re looking for re: drawing on the surfaces?

I’m a little surprised at your second question; while I haven’t actually tried myself, I think I would find it easier to draw some complicated surface (like the ones above — which look awesome by the way!) directly in blender’s 3D editing mode, than to try to figure out an equation whose graph would be that surface. This is the case in 2D, certainly. For instance, when I write calculus exams with problems like “tell me things about this function given only a picture of its graph,” it’s generally much easier for me to draw the graphs with bezier curves in Inkscape than it would be to try to figure out some equation whose graph looks like I want it to and graph it using some mathematical software.

March 22, 2010 at 6:05 am |

Or the shrinkwrap modifier.

March 22, 2010 at 2:54 am |

For some strange reason Scott Carter was unable to post this comment here:

March 22, 2010 at 9:01 pm |

I’ll continue this over at the old place once I’ve found out how to embed videos. I’ve asked how to do that at the TeXnical thread.

October 11, 2015 at 5:14 pm |

acupuncture new york cityModeling Surface Diagrams | The n-Category Café