loading

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 2.4.1.35).

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! :)

<p>If you like diffusion reaction patterns, have you encountered non-nucleated non-diffusion patterns - Spinodal Decomposition... </p><p><a href="http://en.wikipedia.org/wiki/Spinodal_decomposition" rel="nofollow">http://en.wikipedia.org/wiki/Spinodal_decompositio...</a></p><p>It's one of my favourite materials science phenomena...</p>
<p>oh wow, these are neat! <u>There goes my sunday :) </u>http://math.gmu.edu/~wanner/spidec/index.html</p>
<p>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 :-)</p><p>(http://bit.ly/1sz7E2A - because it's short - feel free to ignore the implied sarcasm (-: )</p>
<p>Thanks again! This one looks like I'll need to read more to truly enjoy its beauty and complexity. Sarcasm is welcome, and encouraged :) </p><p>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... </p>
<p>short version, no...</p><p>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.</p>
<p>Super cool. Are these related at all to Voronoi tesselations?</p>
<p>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&amp;safe=off&amp;espv=210&amp;es_sm=119&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ei=UrpBU4rzE8rSyAGCqoGYCw&amp;ved=0CAgQ_AUoAQ&amp;biw=1680&amp;bih=929#imgdii=_</p>
<p>Dear Reza,<br>your link to Dropbox does not work anymore. :-((<br>That&acute;s a shame! Any chance to get the app from you?<br>Many Thanks!!</p><p>Tom</p>
<p>Hi,</p><p>After hitting the output i couldnt find the exported .OBJ file :(</p>
Hey!! <br><br>Look inside the data folder (located in the same folder as the App): <br><br>data/Layers/GreatScottLayer/Assets/models<br>data/Layers/GreatScottLayer/Assets/mel<br>
<p>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.</p>
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!
<p>One more link you might find interesting...</p><p>http://fuckyeahfluiddynamics.tumblr.com/</p>
<p><em>An idea can be perfect</em></p><p><em>but the creation may have flaws</em></p>
<p><em>An idea can be perfect,</em></p><p><em>but the creation can be horrible</em></p><p>You my friend, have both.</p>
<p>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. </p>
<p>quick answer, turn off DRAW POINTS and set EXTRUDE to 0, and screen shot the image, convert to BW with photoshop or the like :) </p>
<p>Very neat! I found a 2D one that's a Chrome Experiment and works in the browser <a href="http://www.chromeexperiments.com/detail/gray-scott-simulation/?f=" rel="nofollow">http://www.chromeexperiments.com/detail/gray-scott-simulation/?f=</a> using the GPU. The author also has JavaScript source code available: http://github.com/pmneila/jsexp</p>
<p>Sweet! Thanks for linking that, it looks great! </p>
<p>If we don't happen to have a Mac - can you release any source on github say ?</p>
<p>Yes and no, right now the project is inside of a bigger project, so it will take me time to distill it into a understandable and modifiable piece of code, but I do plan on open sourcing the code for this application! I'll update this thread when I do! Till then you can check out the shaders used to simulate the patterns (data/Layers/GreatScottLayer/Assets/shaders/)</p>
<p>Those patterns make me nervous... if my skin had them, i would shred it with teeth.<br>Disturbing, yet creative</p>
<p>hahaha thanks! </p>
<p>This is very cool! Thanks!</p>
<p>gnarly! </p>
<p>I have been interested in patterns in nature for some time. Many of the books that I have read go into reaction diffusion in some depth. I do not have a 3d printer but the list of links here is exciting. Thank you for such a great instructable. I am sure that many of the readers will find this instructable to be surprising and a little shocking. </p>
<p>Thats awesome! Please link the books you have if you can, I'd love to learn more about them! :) This book got me started: http://www.amazon.com/The-Self-Made-Tapestry-Pattern-Formation/dp/0198502435</p>
<p>very cool</p>
<p>Thanks Bill!</p>
<p>that's neat </p>
<p>:)</p>
<p>Awesome project!!</p>
<p>Thanks Carleyy! :) </p>
<p>I have to try that when I have a 3D-Printer ready to print. </p>
<p>One way to getting these printed is via shapeways or ponoko! </p>
<p>great links, thanks for putting this together. I'll have to give this a try sometime!</p>
<p>Thanks Amanda! You have some great instructables! I actually read though a couple of your before writing this one! </p>
<p>i dream of a DIY page where 3D print and laser cut don't exist.</p>
<p>looks like a pain to dust :)</p>

About This Instructable

38,605views

250favorites

License:

Bio: 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 ... More »
More by syedrezaali:Your Brain on Pier 9: CNC Milled Corian Generative 3D Voronoi Puzzles CNC Milled Reaction Diffusion Sculpture 
Add instructable to: