Monthly Archives: December 2012

/dev/random v. 1.2.0: Maya Apocalypse Edition

devrandom_1356872526

The art doesn’t look much different, but now the robots are being auto-rendered on a per-comic basis. This means I can change head positions or rotate the bodies a little on the fly to add some variation between panels.

It’s a bit of a step backwards in some ways, but in the long run it’ll make the comic more expressive.

Here’s what it looks like inside Maya. The speech bubbles are moved at render time to fit text of variable length.

Screen shot 2012-12-29 at 4.00.39 PM

And here are a few more comics so you can see the range of variability in the characters’ poses. The trick is to introduce randomness without making the poses too ridiculous.

devrandom_1356846030

devrandom_1356831209

devrandom_1356862664

devrandom_1356844182

Like a Flamingo Among Chickens

he_li_ji_qun

Chinese has many set phrases chéngyǔ 成语: four-word phrases that communicate an idea or concept quickly to someone who knows the cultural and historical context of the phrase.

Some are really easy to understand, like rén shān rén hǎi 人山人海 : people mountains people sea. This place is very crowded!

Others require some knowledge of Chinese history and literature, like máo suì zì jiàn 毛遂自荐 : Mao Sui recommends himself. If you don’t know a little bit about The Warring States period, you might have no idea why your pal Lao Wang yelled this as he jumped up to fix the paper jam.

English-sepaking fans of Star Trek: The Next Generation would do well to think of chéngyǔ as the language of Tamarians: just think of Darmok and Jalad at Tanagra, and how much Tamarian history Picard had to learn before he understood what the Tamarian captain was talking about.

I recently learned a Chinese expression: hè lì jī qún 鹤立鸡群: a crane standing among chickens. My understanding is that it’s used to describe someone or something that stands out from the crowd, but I wasn’t sure whether this should be used in a positive, negative, or ambiguous sense.

My American sensibility led me to think it’s positive, since we tend to celebrate the individual. Boy, that kid does math better than the rest of her class. She’s truly a crane among chickens, and we should praise her achievements.

Or should it be used pejoratively? That kid’s always showing off how good she is at math. She’s truly a crane among chickens, and we chickens should peck her down to size, post haste.

I’ve also seen the expression used by American expat bloggers, describing themselves as wildly different from the people around them. In this sense it sounds akin to the English idiom “sticking out like a sore thumb.”

I follow Hacking Chinese and through that learned about Lang-8, a lanugage-exchange site that pairs up native speakers from different languages. So I asked about 鹤立鸡群 over there and they say it’s overwhelmingly positive.

I’m also now completely hooked on correcting the English grammar of Japanese teenagers. I can only imagine how dumb I sound in Mandarin with my pidgin talk about my cold cup of coffee.

The characters on the sticks are kinda-sorta-puns– 吉 (second tone) can mean lucky, but 鸡 (first tone) translates as chicken.

He 鹤 (fourth tone) is a crane (as in the bird, not the construction equipment), but 和 (second tone) can mean “harmony” or “harmonious,” depending on the context. So if you know the original chéngyǔ that character makes some kind of sense.

ji_he

A flamingo is a 火烈鸟, or fierce fire bird. Which is funny if you think for a minute about how threatening a pink filter-feeder can be.

I’m going to say my newly-minted chéngyǔ is unambiguously positive. You, my friend, are not merely a crane among chickens. You’re a flamingo among chickens. You are just that cool.

The next time you have folks over for cocktails, give the flamingo stick to the guest of honor. Everybody else gets a plain old chicken.

You can download these cocktail sticks for free. 干杯!

Seej bloxen, Ransom

I put this model on Thingiverse a couple of days ago but forgot to put it up on the blog. This is a hollow bloxen for Seej with an articulating door. Players place small wager items inside their own ransom bloxen. Winner takes all.

ransom

Some of the Ransom Bloxen’s design DNA comes from this dice plinth, in particular the flagstones on the base.

ransom_underside

I’ve carved out geometry for an articulating door hinge, but the Replicator’s resolution is too low for it to print; we’re in the sub-millimeter range here. Note that the tiny (and skeuomorphic) rivets print just fine though.

A little 3D printing tip

IMG_1146

I have one spool of blue PLA that prints well at 240° for the first layer and 210° afterwards, and one spool of white that becomes useless hot snot at 230°. Then I’ve got a few rolls of ABS which prefer totally different temperature ranges.

I’m always forgetting which settings to use with which plastics, so I’ve just taken to writing the optimal settings on the spool with silver Sharpie.

This cuts down on a lot of frustration.

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.