3D Printed Reaction Diffusion Patterns




About: Reza is a computational designer & creative engineer. He uses code to express himself, and creates tools and libraries to help others create. He is the author of ofxUI, one of the most popular addons for ope...

Intro: 3D Printed Reaction Diffusion Patterns

I'm inspired by the visual and sculptural works of:

The patterns in their work are out of this world and perplexing! These patterns look very novel and simultaneously feel so familiar. I believe a lot of these artists are inspired by natural pattern formation and generative/biological systems. Recently, I spent some time researching an interesting model for pattern formation: reaction-diffusion systems. Here is an interesting use of reaction diffusion by Karsten Schmidt: https://www.flickr.com/photos/toxi/sets/72157604724789091/ & http://www.printmag.com/article/building_august2008_cover/.

Recently, I've been playing around with Gray Scott's model of reaction diffusion (RD). It's been a ton of fun exploring the different types of patterns that emerge from changing the parameters of a RD system. I wrote an application that simulates and visualizes a RD system in real-time. The application also exports geometry, thus what's seen on screen can be 3D printed and/or used in other applications for product design, scientific research, rendering, etc.

I'd like to share the application with you and the steps involved in using the app to export 3D geometry so RD patterns can be easily 3D printed on a makerbot replicator 2 (however you could use any 3D printer in theory).

Things You'll Need:

Step 1: What Is Reaction Diffusion?

Reaction diffusion system are widely studied and researched because their are argued to be linked to the chemical / biological processes that are responsible for pattern formation in nature (zebra stripes, leopard spots, etc). In addition, reaction diffusion systems exhibit beautiful motion when simulated and visualized. The gifs above showcase different growth patterns and oscillations in RD systems. To see more gifs, go here: http://www.syedrezaali.com/blog/?p=3262

In simple terms, reaction diffusion systems model how one or more substances (i.e. gases or liquids) change and/or combine when mixed in a container. The reaction part of the model describes what happens chemically when the substances combine together (i.e. maybe an entirely different substance is created and introduced into the mix). The diffusion part of the model defines how the substances propagate (i.e. diffuse) in the container (2D or 3D space they are mixed in).

For more technical information about reaction diffusion, specifically Gray Scott's model of reaction diffusion, check out this blog post: http://www.syedrezaali.com/blog/?p=3262 (It's a work in progress, in the post I'll be breaking down the model (mathematically) and describing how to simulate and visualize the model on the GPU using C++, Openframeworks, and GLSL Shaders).

Step 2: Generating Patterns & Exporting Geometry

This is where things start to get interesting! We are going to be generating patterns using the Great Scott!?! App. Download it from here: https://dl.dropboxusercontent.com/u/46826568/apps/GreatScottApp.zip

Here is a quick break down of the Great Scott!?! App (shown in the second and third photos). The app has a couple UI panels:

The "GREATSCOTT" panel allows you to save and load presets. The "UPDATE" and "RENDER" toggles control whether the app is updating and rendering the RD simulation.

The "SYSTEM" panel contains various controls that affect the output geometry, RD system, and form parameters.

The "EXPORT MESH + MEL" button is used to export the current state of the simulation as a closed surface mesh with non-zero volume. The exported mesh can be 3D printed without any additional clean up or post processing! In addition to the generated mesh, a MEL Script is created. This MEL Script generates curves in Maya, which then can be used to create geometry and/or other crazy awesome things.

The "BASE HEIGHT" slider is used to control the thickness of the base of the exported geometry. The larger the base height value, the thicker the exported geometry will be.

The "MODEL PARAMS" section of the "SYSTEM" panel contains controls that manipulate the simulation.

The "SELECT IMAGE" button is used to select the simulation's source input image. Different images will produce different visual results, so be sure to play with various types of images. I've included a couple images above and within the assets folder in the data folder: data/Layers/GreatScottLayer/Assets.

The "RESET" button is used to reset the simulation and zero out the values. I would recommend resetting and randomizing after having selected a new source image.

The "RANDOMIZE" button is used to randomize the values in the simulation. I equate pressing this button to shaking a container containing two liquids of different polarities and seeing them react to each other and then separate or dance with each other until the reaction has reached an equilibrium or a pseudo-balanced cyclic chaotic state.

The "ITERATIONS" number dialer controls how many simulation cycles are performed per frame. If your simulation is not fast enough and you want to see what the pattern would look like if time was sped up, increase this number. However, keep in mind that this will drastically affect the app's real-time performance. So you can always crank up this number in the beginning and when you've found system params that produce interesting results you can always lower this number back to 1.

The "DT" number dialer controls the simulation's time step. Lower time step values will yield better (more accurate) simulation results. I generally keep this number below 0.5.

The "DU", "DV", "DF", "DK" number dialers control model parameters of the RD system. To learn more about what these values mean and how they affect the system, check out: http://mrob.com/pub/comp/xmorphia/

The "SRC PWR" number dialer controls the influence of the input source image. This value controls the in influx of one of the substances in the chemical reaction. Try out positive and negative values to see how they affect the simulation!

The "EXTRUDE" slider controls the height displacement multiplier of the point grid. Each grid point represents a virtual sensor in space that measures the concentration of one of the substances in the RD system (in this case U). The higher the concentration of U at a certain point, the more offset (vertically) the grid point will be in space. Thus, the "EXTRUDE" slider scales the vertical offset of the grid points.

The "RENDER" panel contains various visualization controls. The "FS" toggle to the right of the "RENDER" label allows the app to become fullscreen.

The "DRAW OUTPUT MESH" toggle allows the user to view the mesh that will be generated and exported. I would recommend using this only when your ready to generate some output, otherwise keep it off while using the app.

The "DRAW POINTS" toggle toggles between rendering points and a surface. I like the aesthetic of the points and find it better for seeing the displacement of the mesh.

The other sliders ("POINT SIZE", "COLOR PALETTE", and "COLOR OFFSET") can be used to change the aesthetic of the visualization. Sometimes you can get a better sense of depth and structure by switching up the colors used in the visualization.

The "PRESETS" panel contains various presets that produce visually interesting patterns. By pressing one of the toggle in this panel, you will activate the preset and apply the preset's parameters to the simulation. I would highly recommend cycling through these presets and getting to know how different values of DT, DU, DV, DF, and DK affect the system!

So play with the app and generate a pattern you find interesting! Once you're ready to export geometry, press the "EXPORT MESH + MEL" button. This will generate a closed mesh from the current state of the visualization. The mesh is saved inside of the data folder: data/Layers/GreatScottLater/Assets/model

Step 3: 3D Printing

Now that we have our geometry exported. Lets 3D printed it! If you didn't generate your own pattern, fear not, I've included a couple here that are ready to go!

Regarding 3D printing, I'd recommend following the printing instructions for the 3D printer you'll be working with. The following instructions are for a Makerbot Replicator 2 (Makerware

Open the MakerWare app and create a new file (second photo). Then import a model by pressing the "Add" button. Once you've made your selection, MakerWare will tell you that the Object is too large (as shown in the third photo), and thats okay. Just press "Scale to Fit" to scale the model to fit within the Makerbot's build area (the end result should look like the fourth photo).

Then orient the model so that it is laying flat on the build plate. Do this my pressing the "Turn" button. After rotating the model, press the "Lay Flat" button so the model is in contact with the build plate (as shown in the fifth photo). The press the "Scale" button and then press the "Maximum Size" button.This will scale the model so that it fits within the boundaries of the Makerbot (as shown in the sixth photo).

Now you're ready to print the model! Press the "Make" button and select the level of detail you would like (I usually go with High) and then send it to your 3D printer by either hitting "Export" or "Make It"!

Step 4: Summary & Links

I hope this instructable has ignited your curiosity about natural pattern formation, generative systems, and apps that allow people to explore the parameters of these systems.

If you're interested in learning more about reaction-diffusion systems, here are some links:

If you're interested in learning more about programming, creative coding frameworks, and how to create programs like the one used in this instructable, check out these links:

If you're interested in seeing more things that are inspired by natural pattern formation and/or generative/biological systems, checkout my work and the work I find inspirational:

If you have any feedback, comments, ideas, or questions, please comment! :)

Data Visualization Contest

Second Prize in the
Data Visualization Contest



    • Optics Contest

      Optics Contest
    • Electronics Tips & Tricks Challenge

      Electronics Tips & Tricks Challenge
    • Plastics Contest

      Plastics Contest

    43 Discussions


    Reply 4 years ago on Introduction

    oh wow, these are neat! There goes my sunday :) http://math.gmu.edu/~wanner/spidec/index.html


    Reply 4 years ago on Introduction

    I probably should have mentioned that these are the alternative to eutectic decomposition - which is diffusion controlled - but will give you another search term to play with :-)

    (http://bit.ly/1sz7E2A - because it's short - feel free to ignore the implied sarcasm (-: )


    Reply 4 years ago on Introduction

    Thanks again! This one looks like I'll need to read more to truly enjoy its beauty and complexity. Sarcasm is welcome, and encouraged :)

    By any chance do you know how to discretize the laplacian operator for simulation? I'm playing with the displacement (dx, dy) and seeing how that affects the scale of the patterns generated...


    Reply 4 years ago on Introduction

    short version, no...

    long version - tempted to say Noooooooooooo.... but in reality, I recognise the words and know what you are doing but it's been 2 decades since I did that sort of math... or anything materials engineering - got sucked sideways into IT due to lack of work in my chosen field.

    Thanks! :) Kinda... from my understanding, a voronoi tessellation is a mathematical way of defining how points in a space subdivide that space into cells. Reaction diffusion is related because of the nature of the patterns create and the origins of how those patterns form. For example, when things (cells and micro organisms) grow in nature, they grow and diffuse until they hit another substance, this naturally divides the space they have to grow into cells. Such as bacteria growing in petri dish: https://www.google.com/search?q=agar+plate&safe=off&espv=210&es_sm=119&source=lnms&tbm=isch&sa=X&ei=UrpBU4rzE8rSyAGCqoGYCw&ved=0CAgQ_AUoAQ&biw=1680&bih=929#imgdii=_


    7 months ago

    Is this app dead? The link doesn't work. Would really like to try the app.


    11 months ago

    Great Tut! Link to Greatscottapp.zip is no longer active. Any other link avaialble???


    1 year ago

    It look's very interesting.

    I have downloaded the folder though and my iMac says that I can't install it

    because it's not an AppStore app? How can I resolve this? My iOS is 10.12.3


    1 year ago

    Dear Reza,
    your link to Dropbox does not work anymore. :-((
    That´s a shame! Any chance to get the app from you?
    Many Thanks!!



    Reply 3 years ago on Introduction


    Look inside the data folder (located in the same folder as the App):


    I really want to delve into this. How much of an expertise in math do you have to understand all of this. I'm just barely starting to take an interest in math.

    1 reply

    Heyy Diestraysiniestra! Great! To make this instructable, you don't need to know a lot of math. I've done that for you guys inside of the app! But if you want to dive deeper into the topic at hand, I'd recommend knowing variable calculus and differential equations. The good thing to know is that you don't need to know all of mathematics to play with interesting equations, I'd say algebra and geometry are fundamental tho!


    4 years ago on Introduction

    One more link you might find interesting...



    4 years ago on Introduction

    An idea can be perfect,

    but the creation can be horrible

    You my friend, have both.


    4 years ago on Step 2

    Is there a way (without Maya) to convert these files into black-to-white gradient maps? Black should be the deepest point, white should be the surface. Then they can be engraved in 3D mode on a laser.

    1 reply

    quick answer, turn off DRAW POINTS and set EXTRUDE to 0, and screen shot the image, convert to BW with photoshop or the like :)