Stickzilla, or: Triangle Meshes Hate Us

June 10th, 2010 by Stephanie Leave a reply »

After we used Sprinklation to modify pictures into printer-friendly images, our next step was to give these Sprinkles a third dimension. For that we needed Blender, a vastly complex (but free!) 3D modeling program that lets you script in Python. One of the reasons we chose Python for this project in the first place was that so many CAD-type programs utilize it.

To script a 3D object you need to specify the coordinates of its vertices. In the case of a Sprinkle- which is essentially a cube- eight of them. But all we really need for that is the uppermost “origin” coordinate of each Sprinkle, and a Sprinkle’s length. Those three elements are what we exported from our Python program as a text file- and then imported into Blender. Once there we scripted the creation of each Sprinkle we were given, using an arbitrary value for the height of every one. Changing this “z value” is something we’ll come back to later when we start exploring different topographical heights in our images.

This all sounds pretty straight-forward, but right here is about the time we started running into problems- all of which came up as marvelously cryptic error messages when we ran this Blender output through Skeinforge. (Skeinforge is an open-source print-head mapping software that translates 3D models into something the Cupcake can use).

Our first problem had to do with a warped triangle-filled structure that we were getting instead of a clean, solid cube. If you specify four vertices they should make a face, right? I mean, a square face only has four vertices. Turns out if you don’t list the vertices in order (clockwise or counter-clockwise), the entire thing twists itself up and then the computer explodes. (not really).

So for future reference, a “hole in the triangle mesh”, despite the fact that there aren’t supposed to be triangles in your image anywhere ever, means something along the lines of “you fail at playing connect-the-dots.”

Here are some pictures from Blender:

We refer to him fondly as Stickzilla.

Advertisement

Leave a Reply

Powered by WP Hashcash