Introduction: How to 3D Print an Animation Inspired by Kurt Vonnegut's Slaughterhouse-Five

Most 3D printers work by taking a 3D file (like an STL), and slicing it into a stack of 2D files. The 2D files are then printed one on top of the other to create the final 3D form. Here we'll start with a 2D animation and use the individual frames as slices to create a 3D object.

Our animation is going to be a simple particle simulation -- circles that move around and stick to each other. The 3D form will show the paths of these circles over time.

This idea came to me after reading Slaughterhouse 9 by Kurt Vonnegut. In the book there are alien creatures that experience time differently:

Billy Pilgrim says that the Universe does not look like a lot of bright little dots to the creatures from Tralfamadore. The creatures can see where each star has been and where it is going, so that the heavens are filled with rarefied, luminous spaghetti."

So these aliens see all points of time in an instance--spherical stars are drawn out to tubes. We're going to replicate that as best as our tiny human brains can comprehend.

Step 1: Plan Out Your Printer Procedure.

I'm going to use Ember a desktop SLA printer. A typical workflow for Ember is: Create a 3D CAD model, export it as an STL, open up the STL in a slicing program (e.g. Autodesk Print Studio or Slic3r), and finally send a stack of black and white PNGs to the Ember printer.

Instead of starting with a 3D model. We'll jump to creating the stack of PNGs directly.

Note: Though I'm using an Ember printer, many of the principles in this Instructable are applicable to any other SLA or FDM type 3D printer.

Step 2: Use Processing to Generate an Animation

Picture of Use Processing to Generate an Animation

We'll use Processing to generate the animation that we'll print. Instead of writing a sketch from scratch we'll save time by modifying a pre-made example. Let's use the "Flocking" example from Chapter 6 of Daniel Shiffman's Nature of Code. This book is free and all the examples can be downloaded from this Github page.

This example shows a bunch of triangles called "Boids" that fly around the screen. We want to print a form that shows how these boids moving around over time. Now, to make this work for a 3D printed form we're going to have to make several modifications to this Processing sketch:

  • Set the size to 1280 x 800. This is the native resolution of Ember's projector.
  • Change the appearance of the sketch. When printing with an SLA printer like Ember each slice must be a black and white image. The white areas are printed and the black areas are left to be empty space. So change the background color to black and the boids to solid white. We'll also change the boids from triangles to circles just to make things a little simpler.
  • We can modify the behavior of our boids (now represented by circles) by adjusting the cohesive, repulsive and alignment forces. These parameters are located in the Boid class.
  • We need to add a line of code to export the frames in a format that our printer can read. Ember requires PNG files with the name "slice_1.png", "slice_2.png", and so on. So our code looks like: saveFrame("data/slice_"+counter +".png"); This line is at the end of the draw() function. Before it, a counter increments every frame.

There are a couple of other very important issues that must be considered for printing this animation....

Step 3: Eliminating the Need for Support Structures in the 3D Print

Picture of Eliminating the Need for Support Structures in the 3D Print

Since 3D printing is a layer by layer process, when a layer is printed it must be supported by the layer beneath it. A particle standing still or moving slowly it will form a straight or angled pillar -- this is great and will be no problem when printing. If the particle is moving too fast -- so fast it moves so far in a single frame that there is no overlap with the previous frame -- it won't be able to support itself. We'll prevent this from happening by lowering the max speed of a particle.

Another issue with our current sketch is the boundary conditions.Currently, when the particles leave the left side of the screen they wrap around to the right. That will be a big problem when we try to print them: When a particle wraps around it is suddenly in mid air and because it is unsupported it will fall down. Instead make simple boundary conditions (pictured) that reflect the particles back when the approach an edge. The ensures that a particle in a given layer will always be—at least partially—on top of the previous layer .

Step 4: Create and Send the Print File.

Picture of Create and Send the Print File.

This step is fairly specific for Ember, but keep in mind this type of 3D print can be done on pretty much any kind of 3D printer.

An Ember print file is a compressed archive (either .zip or .tar.gz) that contains a text file called "printsettings" and a series of PNG's labeled "slice_1.png", "slice_2.png", etc. We've already created the PNGs in previous steps. The best way to create the Ember printer file is to use Print Studio provided via Spark: https://spark.autodesk.com/

Simply import any STL file -- it does not matter what -- and set the appropriate layer and resins settings. Then after you preview the slices, click "Export Printer File". Unzip this file, copy the printsettings file and paste it into the folder containing the PNG stack. Open this folder, select all of the files, then compress them. The "Archive.zip" file that is created is what you will send to Ember.

For a more detailed procedure check out this Instructable by Arian of the Ember team: https://www.instructables.com/id/Using-Processing-w...

Everything is ready to print and that's it!

Step 5: Use the T2Z Software to Create Animations and STL Files

Picture of Use the T2Z Software to Create Animations and STL Files

While working on this project I found that other people have been working on something very similar! It's called the T2Z or "Freezing Time" project. Basically, they wrote processing code that allows you to interact with sliders to create geometric, looping animations. You can export the animation as a GIF or the individual frames as a folder of PNGs. It also exports STL files!

Here's a fantastic step-by-step guide to getting it work: http://htmlpreview.github.io/?https://github.com/e...

Some T2Z links:

Read about it: http://www.realtimerendering.com/blog/freezing-ti...

Download the Processing code: https://github.com/erich666/T2Z

Thanks for reading this Instructable! Please let me know if you have any questions or difficulties.

Comments

DuncanvilleLocksmith (author)2016-03-01

this is best

mchau2 (author)2016-02-05

processing? hm cool tools, i would totally check it now now, haha may google as my witness

Steve Crayons (author)mchau22016-02-05

Yep, I <3 processing. If you want to get right into it I suggest starting with the program I mention at the end. You need to install a few libraries, but they include thorough instructions.

Karsaell (author)2016-02-04

I love the idea !
Personnally, I always picture timely steps in a sort of additionnal space direction (because of computer programming and how my brain works), and your explanation of the principle felt like just out of my head !

Although, I do think the effect would be more grasping with a representation of something anyone can quickly recognise, like someone walking for instance, with the legs moving from one step to the other over the width of the object.

Steve Crayons (author)Karsaell2016-02-05

I agree, the example I choose isn't super relateable. I wanted something that I could produce quickly in Processing. I'll keep my mind open and think about more natural example. Thanks!

Nyxius (author)2016-02-05

May I suggest that the particles experience a 1/R^2 force of attraction? with random starting velocities, and that they simply disappear when leaving the edge. This will make each line a conic section, and it looks very awesome. They will weave around eachother instead of colliding and looking angular.

Nyxius (author)Nyxius2016-02-05

This is an example: http://www.nowykurier.com/toys/gravity/gravity.swf

Warning, this is an extremely addictive toy if you have ADD.

Steve Crayons (author)Nyxius2016-02-05

Yeah, that's a great idea! I thought about 3D printing the solar system basically just like this GIF: http://www.universetoday.com/wp-content/uploads/20...

The circular paths of the planets would form helixes around a central post (the sun).

shalomo (author)2016-02-05

Great Instructable, Steve! The clear resin with the UV light sure does a great job creating that "luminous spaghetti" effect.

Jedi_zombie85 (author)2016-02-05

very nice idea and great results

Owen Baylosis (author)2016-02-04

It would be cool to print a horizontal MRI clip and make a body

efahrenholz (author)2016-02-04

It took me awhile to wrap my head around what you were attempting to demonstrate but now I see it. Very cool idea! Definitely need to try this out. Don't have a resin printer, but might work fine on a filament based printer.

Thanks! glad you liked it! What could I do to explain this better?

About This Instructable

3,812views

47favorites

License:

More by Steve Crayons:Variable Slicing for 3D Printing on Autodesk EmberEmber 3D Printer Build Arm TeardownHow to 3D print an animation inspired by Kurt Vonnegut's Slaughterhouse-Five
Add instructable to: