# Processing

We already mentionned the book The Nature of Code in a previous post and on our bibliography page, a fantastic book to understand basic concepts of “computational design” with Processing such as vectors and fields. Daniel Shiffman now has great videos to teach these concepts on his VIMEO Page, here is the first of the series:

Arthur C. Clarke’s documentary on Fractals:

A basic set with fractal behaviour is the set of Complex numbers (C):

No matter how much one zooms in or out, the set is self-similar with infinite detail.

The typical fractal sets (Mandelbrot, Julia, Fatou) follow a pattern of 3 infinities: an infinite number of points is run an infinite number of times through a recursive polynomial and it will/will not reach infinity:

To make the step to 3d, the major issue is that the 2d rules cannot be generalized  because there is no corresponding set of numbers for 3d space. 1d space has Real numbers, 2d space has Complex numbers, but there is no 3d equivalent. However, Quaternions (hypercomplex numbers) are a theoretical set of points corresponding to a 4d space. Therefore there are two possible approaches: a) Define a three dimensional set of points in polar coordinates and switch them back to a cartesian coordinates in order to build it in computer space. b) Build a theoretical 4d fractal using hypercomplex numbers and cast its 3d shadow in 3d.

Either way, results are similar:

Dealing with infinite numbers, infinite iterations and infinite sets of points, computation times become an issue. One way around this is to build ray-traced images estimating distances to a virtual fractal (not physically storing the points of the fractal in memory):

The image above is magnified ~3.10e13 times. In other words, presuming the size of the sectional model is 1m, it scaled up to roughly the size of the Solar System.

Building 3d models in computer space is slightly trickier because of the huge number of points involved to define even a limited section of a fractal. The issue is to define an algorithm for the correct order of the points in order to build a mesh. A rather neat solution is to ray-trace consecutive sections through a fractal (ray-tracing involves a Z-buffer anyway) and work from there. Here is an example (a 38,000,000 face-mesh obtained from 1,000 sections):

An important tool in exploring 3d fractals is building Julia sets (the only difference is that they use a constant increment at each iteration rather than the initial step):

Software used for my project: Processing, ImageJ FIJI, MeshLab, Netfabb Studio, Jesse’s MandelBulb 3D, Autodesk 3dS Max, Chaos Pro, Adobe Premiere.

Here is the book that I kept mentionning in the tutorial: The Nature of Code by Daniel Schiffman

The book explains many algorithm that attempt to reproduce natural systems (including swarms and fractals) using Processing, the java-based scripting interface.

You can download the book and make a donation or buy the hard copy. Try some examples, register to the Processing forum and to StackOverflow.com. Ask for help on the Processing IRC Channel.

For some example, you will need to need to download the Toxiclibs library and you might want to use the Eclipse IDE to speed up your workflow. You can also follow the great Plethora-Project.com tutorials by Jose Sanchez.

Below are several Reaction Diffusion System apps which help to understand the parameters at play on the famous algorithm developed by Alan Turing (1912-1954).

The first one is programmed in Java: http://cgjennings.ca/toybox/turingmorph/

The source code is available for you to tweak in a java app, you can use the Eclipse IDE (integrated development environment) to program in Java and test the results:  http://cgjennings.ca/toybox/turingmorph/TuringMorph.java

The second one is programmed using Processing which is a language based on Java: http://www.openprocessing.org/sketch/15905

A 3D processing app and pavillion design was done by BioThing (Alisa Andrasek and Jose Sanchez) based on the same Turing patterns: http://www.biothing.org/?p=449  Biothing also held a workshop with the DRL studio based on 3D reaction diffusion patterns:

Some of Biothing’s code is available on their Genware website. Some Processing tutorials are available on this great website by Jose Sanchez: http://www.plethora-project.com/

Finally, the creators of Hoopsnake, Volatile Prototype,  have created a processing library, ReactP5 to create Reaction-Diffusion patterns in 3D: http://volatileprototypes.com/libraries/ReactP5/

This is my submission for the Digital Representation module at the University. The first part focuses on learning how to use Bentley’s Generative Components to explore geometry and in particular ruled surfaces. The module tries to give an insight into understanding how to construct geometry and how the process can be developed parametrically. It then explores creating your own object classes and feature types to expand the abilities of the software and increase efficiency in modelling. Finally the module looks at developing an understanding of scripting and the syntax needed to code 2D and 3D computer programmes and models using both Processing and scripting within Generative Components. The second part looks at using the tools to develop our studio proposals, in my case the proposal for a pavilion at Burning Man Festival.

Karsten Schmidt has just posted the source code from the Processing Workshop which I organized  at Metropolitan Work with Marcus Bowerman. On Toxiclibs, he explains how to import the files using the java editor Eclipse. I posted some pictures on my website too. Below are couple images and pictures of the workshop:

Above: The class on the first workshop day

Above: Karsten showing how to make mesh faces on Processing

Above: The Rapid Prototyped model exported from Processing developed on the first day

Above: The Processing  façade app which was developed on the second day : Define a façade in plan on the right using a curve, add and control points on the façade with particle physics and use voxels to solidify.

Tom Beddard, Physicist, Animator and Web Developer, explores the relatively new field of 3D fractals. By writing his own software to render new sets of mathematical algorithms that generate 3D structures with unlimited detail. He investigates the resulting wide range of structures ranging from the natural and organic to geometric and artificial, appearing from purely mathematical space.

A collaborative effort on developing 3D fractal algorithms on fractal forums has enabled many programmers to start exploring this new field; free web software generates interactive 3D fractals in real time.

Generating fractal images is more like exploration than design and Tom Beddard explores an entire ‘fractal planet’ shown in the videos below. More information at SubBlue.

Above: Raytraced 3D fractals using Pixel Bender