//js/thickbox/thickbox.css" type="text/css" media="screen" />

Auto-Rendering STL Files to PNG

Posted by Adam on Tuesday Dec 1, 2009

z_axis_arms

For the past few months I’ve been messing around with django and writing a web-based inventory system thing for Hive76. One of my goals was to auto-generated nice renders of STL files people attach a-la Thingiverse. Sure, I could have just asked Zach, but where’s the fun in that? Since I don’t know a damn thing about 3D modeling or any of the tools used for this, it ended up taking me a lot longer than I expected. The result is this very short shell script, with all of the work being done by stl2pov and povray, with a little help from the Axes and Grid Macro to pretty things up a bit. Here is the povray template I’m using and here is the shell script:

#!/bin/bash

STL=$1
BASEFILE=`echo "$STL" | sed -e 's/\.stl//g'`
OUTFILE=${BASEFILE}.png
POVFILE=${BASEFILE}.pov
INCFILE=${BASEFILE}.inc

stl2pov -s "$STL" > "${INCFILE}"
MODELNAME=`grep "#declare" "${INCFILE}" | cut -d\  -f2`
cat pov_layout.tmpl | sed -e "s/{{INCLUDE_FILE}}/${INCFILE}/g" \
       -e "s/{{MODELNAME}}/${MODELNAME}/g" > "${POVFILE}"
povray -s -i"${POVFILE}" +FN +W1600 +H1200 -o"${OUTFILE}" +Q9 +AM2 +A2
echo "OUTFILE: ${OUTFILE}"

That’s it!

I still haven’t made the script intelligent about camera positioning relative to model size, but since most of the models we design are intended to be printed on our MakerBot, the hard-coded values seem to work pretty well. Anyway, if you know about this stuff and see something I could do better, or you have any other cool ideas, I’m all ears.

Tags : , , | 6 comments

3D Printed Engagement Ring

Posted by Adam on Tuesday Oct 13, 2009

MakerBot Printed Ring

A few weeks ago, my buddy fynflood hit me up on IRC (yeah, we’re oldschool) because he needed help with a project. It would appear our boy got some strange notion in his head that his old lady needed to be gettin’ wifed up here pretty soon, so instead of going the traditional route, he decided to design her a cool ring and print it out at Hive76 on our brand-spankin’-new MakerBot. That’s where yours truly comes in. See, our boy fynflood hasn’t earned his SketchUp merit badge yet, so he tossed me a png he designed in gimp, which I traced and scaled to a standard ring size. There were some issues with smoothing surfaces and not printing solid, but he worked them out and was able to present her with the ring on their trip to Iceland. She said yes. Score one for the nerdy dudes.

Successful marriage proposal via 3D-printed ring – Boing Boing.

Tags : , | 2 comments