As promised!

Step one: model 11:45 in sketchup. Step two: take model apart in sketchup by tediously rotating polygons. Surely there is some way to script this, (modulo the computationally nontrivial part of avoiding overlapping polygons) but I took the scenic route this time. Step three: write horribly ad-hoc perl script to convert from the COLLADA data exported from Sketchup (exporting "Google Earth 4" yields a file that is secretly a .zip of COLLADA despite its .kmz extension) to postscript

```sub group {
my (\$n) = shift;
my @rv;
while (@_) {
my @buf = ();
for (1..\$n) {
push @buf, shift @_;
}
push @rv, [@buf];
}
return @rv;
}

my \$ninputs = 0;

while (<>) {
if (m(<float_array id="mesh(.*?)-geometry-position-array" count="(.*)?">(.*?) </float_array>)) {
push @c,  {vertices => [group(3, split /\s+/, \$3)]};
\$ninputs = 0;
}
if (m(<triangles(.*?)>)) {
\$ninputs = 0;
}
if (m(<input(.*?)>)) {
\$ninputs++;
}
if (m(<p>(.*?) </p>)) {
\$c[\$#c]{triangles} = [group(3, group(\$ninputs, split /\s+/, \$1))];
}
}

sub plot_vertex {
my (\$x, \$y, \$cmd) = @_;
print "\$x \$y \$cmd\n";
}

print "0.5 0.5 scale\n";
print "0 400 translate\n";
for my \$p (@c[0,1]) {
print "%%% MESH\n";
my \$vs = \$p->{vertices};
my \$ts = \$p->{triangles};
for my \$t (@\$ts) {
print "newpath\n";
plot_vertex(\$vs->[\$t->], \$vs->[\$t->], "moveto");
plot_vertex(\$vs->[\$t->], \$vs->[\$t->], "lineto");
plot_vertex(\$vs->[\$t->], \$vs->[\$t->], "lineto");
print "closepath fill\n";
}
}
```

Step four: import into illustrator, fiddle with colors and such. (pdf file here if you wish to make your own)

Step five: print out and assemble. (the arms didn't make it) Step six: Rock out. Step seven: Rock out some more. Tags:
• #### (no subject)

Guy from Seattle team we've been working with showed up today at work; no matter how much I'm generally comfortable working with remote teams (and I…

• #### (no subject)

Sean's back in town --- good fun working with nonremote teammates.

• #### (no subject)

Sean's in town at work, good times.

• Post a new comment

#### Error

Anonymous comments are disabled in this journal

default userpic