A cookie-cutter blog post

bread

It lightens my heart to know that Nikolaus Gradwohl has dedicated some of his time to producing a piece of software that generates 3D models of cookie cutters. I stood on his gigantic shoulders to make these Gingerzombies first on my Replicator and then in my kitchen.

I do almost all of my 3D work in Maya 2009. Once or twice I’ve hopped over to OpenSCAD, but for these models I used a little piece of free software called, appropriately, the Cookie Cutter Editor.

I started the process in Photoshop with a pair of gesture drawings.

gesture

And then filled out the gestures to make outlines of gingerbread men. While doing this one has to keep in mind how the final product is going to cut from moist dough and bake, so a little modification of the pose was necessary. The pose also has to read in silhouette to maintain the illusion of life.

trace

Next, bring the drawing into Maya and trace it with a polygon. We can skimp on the geometry a little because the outline will blorp out in the baking anyway. Then extrude, and we’re good, right? Easy peasy mac and cheesy.

maya_runner

Not so, alas. Take a look at these self-intersecting extrusion edges– it’s a common plague for me with modeling in Maya. The image on the left is a small edge extrusion, but once one extends the extrusion out, tight corners begin to intersect and produce unusable geometry.

extrusion

You could go through and merge those vertices, but it can get pretty tedious, especially with a complex model.

So I downloaded Cookie Cutter Editor, imported my drawings, and started tracing. Cookie Cutter Editor isn’t fancy, but it is very easy to use and it does the job.

cceditor

The only problem with it is the way one places vertices; you don’t connect the dots by drawing in sequence, but rather by adding vertex between two existing vertices. I don’t see a way to specify which two verts are the endpoints, so one ends up moving a lot of vertices around to follow a complex outline like a gingerzombie. This could take a very long time.

What to do? I’ve already drawn the cutters in Maya, so I just have to get the data from Maya to Cookie Cutter editor. This seems like a lot of work for a pair of cookie cutters, but now I have a problem to be solved, and that’s way more interesting than cookies.

In fact, forget the cookies, this is now a data manipulation project.

First I have to see what kind of information CCE puts out. I made a squarish cutter and exported the data.

square

Which exports the following:

414.0 65.0
427.0 404.0
76.0 408.0
76.0 62.0

Space-delimited Cartesian data separated by carriage returns. Love this. If you ever want to put something in my stocking for Christmas, get me a properly-formatted text file.

It looks like the minimum and maximums on these are 0 and 500 pixels, and CCE draws its polygons clockwise. That should be easy enough.

After a few minutes of fiddling, I have this MEL script. (MEL is Maya’s internal programming language. It’s really useful for automating repetitive tasks.)

proc export(){

$foo=”meshname”;

int $i=0;

# change 156 below to the number of verts in the mesh

for ($i=0; $i<=156; $i++){
$vert=$foo+".vtx["+$i+"]";

$loc=`xform -ws -q -t $vert`;
print ((int($loc[0]*10))+".0 "+int($loc[2]*10)+".0n");

}

}

export()

This is ugly, ugly code, folks. Some kid just starting out could get hurt on this stuff, so don’t use it as an example of how to write MEL scripts.

A quick copy/paste from Maya’s editor into TextEdit and CCE’s import looks like this:

runner_CCE

The export is a single keystroke and then I’ve got an STL file. netFabb doesn’t like it. The red polygons are suspicious for some reason. It’s also flipped left to right.

runner_netFabb

So I bring it back into Maya to take a closer look.

intersecting

Huh. Intersecting polygons. Exactly what I was trying to avoid when I started this process.

Phooey.

The goal here isn’t to produce a watertight mesh, it’s to get a working cookie cutter in the physical world, so let’s see what ReplicatorG will do with it.

runner_repG

ReplicatorG is the Honey Badger of slicing software. ReplicatorG don’t care. ReplicatorG’ll slice anything. Usually these slices print just fine, but in this case here’s the real-world result of intersecting geometry.

slicing_error

It’s certainly usable, but it’s a little weird and ugly. Here’s the final print:

gingerzombies

Download the models here from Thingiverse. Merry Christmas.

3 thoughts on “A cookie-cutter blog post

  1. Andyways

    If you feed the STL into Netfabb cloud, it should cleanup the intersection areas.
    I wish Maya’s extrude could properly weld the verts when an extrusion intersects… Sigh.

    Reply
    1. zheng3

      Thanks, I’ll give that a shot.

      Netfabb basic just closes the entire mesh, which isn’t very helpful. Kind of negates the whole idea of a cookie cutter.

      Reply
      1. Andyways

        Totally.
        I had given up on netfabb basic after giving it a once over. The cloud service does a great job of creating a unified mesh. It has become a key part of my 3d printing prep workflow. It also does a good job of merging (boolean union) multiple pieces of geom that Maya’s boolean will make “magically disappear” :)

        Happy Holidays!

        Reply

What do you think?