Update: I figured out how to save STL files right out of the browser, so the bit about needing a server is unneccasary. You can demo that here.
Update 2: Seems like I was too late in developing this, and it got sniped :( It got in tech crunch recently. See that here
The UChicago 'hackers' group, hack@uchicago, that a few friends and I started on campus a few years ago has grown considerably. Since our hackathon last year in the spring took place at the Booth School of Business and certainly had a very corporate, startup-weekend type of feel to it we decided to go the other direction this time.
The result was our first (Un)hackathon, where the only rule was that you had to go beyond the functionality built in to the standard MVC framework (I'm looking at you, Rails). Inventables sponsored the weekend and brought a couple 3D printers and CNC machines for us to hack on, which was awesome. Constraints breed creativity, and we got some pretty cool projects going: a Portal turret, a digital ammo counter built into a Nerf gun, a portable N64 and many others.
I really wanted to built an interface for designing some kind of 3D object in browser, and have it come off the web and directly into the 3D printer (i.e. in an STL file). Seeing things like a web based cookie cutter designer led me to think about similar problems with a "reduced dimensionality": they are technically 3D objects in their final form but can be easily represented in 2D. This not only makes them quick to store and transport, but this class of objects is much, much easier to modify with the 2D tools we have (screen, mouse, etc).
I used the metaphor of a lathe (or potters wheel) because it involves exactly this type of reduction in dimensions. While a cookie cutter is a 2D path extruded into 3D space, a lathe takes a 2D path and revolves it around an axis to create a 3D object. Radial symmetry isn't a contrived 2D -> 3D conversion either, you see it in many daily objects, like wine glasses and vases. With that metaphor in mind, I started out to create a digital lathe.
There are a few different parts to this project:
The fancy renderings are part of v0.0.0.0.2 that I made a couple days before ORD Camp last weekend. Zach Kaplan, Inventables CEO, invited me to come volunteer at ORD Camp and show off the lathe and help organize and introduce people to the 3D printers they brought.
I moved the system to Rails, to take advantage of built in database support and try out a couple of different queuing systems, I ended up using Sidekiq. I needed some sort of delayed job system because I wanted to move the mesh generation process and rendering out of the servers way. While mesh generation usually takes less than a second, rendering with a ray tracer could take up to a couple minutes, so it needed to be done in the background. You can see the code for the new version on Github.
I used POVray to do the raytracing, and in the process started to compile my own little ruby library for ruby that outputs POVray. I made it into a gem which I'll put out soon. It is super experimental, but it is way better than writing POVray files by hand.
I'll write a part 2 on the particulars of how it works, the iPad version, and plans for the future. Coming soon.
In the mean time, here are some samples of what came out of the 3D printer, straight from the web interface!