Organic Modeling Techniques Part 1: Reaction-Diffusion

Before I get started with today’s post, I’m happy to announce the completion of my book, “Grasshopper: Visual Scripting for Rhinoceros 3D,” which is tentatively to be published March, 2017.  This a basic introduction on the use of Grasshopper for 3D modeling. I wrote it with the Rhino user in mind who would like to start using Grasshopper in their work-flow, although the presumed knowledge of Rhino is kept to a minimum. The book is organized in three parts: Part 1 is a basic run down on how to use Grasshopper, with simple examples to showcase use of the most basic components. In Part 2 contains a handful of more sophisticated examples, to show how you can combine the elements discussed in Part 1 to create complex forms. Part 3 is a reference guide for all of the Grasshopper components.

For those attending the Joint Mathematics Meetings in Atlanta, I’ll be giving a 20 minute presentation on Grasshopper tomorrow (Thursday, January 5th) at 2:00pm in the MAA invited paper session on “Technical Tools for Mathematical 3D Printing.”

2017 looks to be a busy year for me. My design consultancy business has started to take off, which has led to a number of really interesting projects that I’ll be writing about here. One of the topics I’d really like to delve deeper into this year are the ways in which one can mathematically model organic forms for the purpose of art and design work. This is a very old endeavor, but I’m hoping I can contribute in some way.   This series of posts are really my way of cataloging the different strategies I’ve found to attack the problem of organic modeling with mathematics.

Organic forms have inspired design work,  perhaps since “design” was a thing. Last summer, while visiting ICERM in Providence, I was on a tour of the Rhode Island School of Design’s nature lab. The variety of specimens they had was absolutely breathtaking, and all in service to their design students. There was an entire room of human skeletons, endless cases of coral and seashells, a whole lab full of microscopes for studying microscopic forms, etc.

Readers interested in organic forms can do no better than start with D’Arcy Wentworth Thompson’s classic work,  “On Growth and Form,” first published in 1917. As far as I’m concerned, everyone remotely interested in art, design, biology or mathematics should have a copy of this on their bookshelf. Given how old this work is, it’s shocking how much is there: logarithmic spirals and seashells, branching forms of antlers, polyhedra and cell structures, phyllotaxis and plant growth, etc.

I’ve written previously about the mathematics of seashells and branching (vein) structures. In this and future posts I’ll discuss some more modern topics that are now well known, but too new to have been included in Thompson’s book. This first one I’ll tackle is reaction-diffusion equations, which are commonly used to model things like leopard spots, tiger stripes, and finger-prints.

For the non-technical reader, reaction-diffusion equations are a system of differential equations. Typically there are two of them, and they model two competing populations in a 2-dimesnional region of the plane. The best explanation I’ve seen of the mathematics is by Karl Sims, found here. In that web page he describes a discretization of the reaction-diffusion equations called the Gray-Scott model.

The model begins with a 2-dimensional grid. At each grid point there are two numbers, which encode the concentration of chemicals A and B (or size of two populations, etc.). In Sims’ description, A represents food and B represents an organism that eats it. In the model, each grid cell is continually being given chemical A at some “feed rate”, and organism B eats it and reproduces. In places where there is not enough food, organism B dies off with some “kill rate”. Initially concentrations of A and B, and the feed and kill rates, determine the eventual behavior of the system.

In the Fall of 2016 I had an independent study student, Sachi Watase, work with me on the problem of translating the Gray-Scott model to work on an arbitrary mesh. The first step was to code the Gray-Scott model in Python/Rhino3D (later this was done in Python/Processing). Here are some images Sachi generated.

The idea for the project was to take a 2D mesh with any topology, assign concentrations of A and B at each vertex point, and then evolve the system. It was a very computationally demanding project, since the fate of A and B at each vertex depends on a linear combination of the concentrations of A and B at all neighboring vertices.   Exactly which linear combination to choose proved to be a difficult task, especially for meshes with vertices of varying degree (i.e. different numbers of edges coming into each vertex).

Visualization of the results was done in a number of ways. One strategy was to use the level of B as a gray-scale value to color the mesh. Another was to use B as a variable offset amount to add texture, as in the two images above. Below is the result of a reaction-diffusion equation implemented on a toroidal mesh.

In the end we had the most success with a quad mesh with valence four at each vertex (necessarily a torus, for topological reasons), as in the image above. However, I’m hoping this project continues, and sometime this year I’ll be able to share images of interesting textures/colorings on meshes with lots of different topologies.

 

Leave a Reply