My conant node generates a "Conant Gasket" pattern. I was uncertain whether it was node-worthy, but after posting a still image and an animation that attracted some attention on Instagram, I decided to share it.
A Conant Gasket is a fractal pattern which produces a non periodic tiling of any rectangular region. It is formed by repeatedly weaving increasingly smaller strips, first vertically then horizontally for each generation, thus subdividing the rectangle into smaller cells which form a pleasing pattern.
For more about Conant's Gasket see: https://digitalcommons.dartmouth.edu/cgi/viewcontent.cgi?article=1392&context=cs_tr
The best way to understand it is to play with the demo (attached - see screenshot).
The screenshot shows a generation 3 gasket colored with natural shades of green with a simple gradient applied to each cell. If you render just the conant node and step through generations 1 through 6 you will see how the weaving pattern progresses.
Fractals like this require general recursion, which NodeBox does not do. The workaround is to hardwire the recursion by feeding a generation1 node into a generation2 node, feeding that into a generation3 node, and so on. All these generation nodes are identical, so you can quickly copy and paste as many as you need and then wire them together - which is exactly what I did inside the conant subnetwork. Instead of providing a single switch to let you choose the generation I made a cascade of switches; this improves performance. Without this trick Nodebox would have to compute all the generations before deciding which one to produce.
Six generations produces 1201 cells and takes about 2 seconds to run on my MacBook Pro. The number of cells increases exponentially with each generation, so I decided to limit it to six. If you ever needed more and had the time to spare, it would be easy to allow a few more generations by just adding more generation sub-subnetworks.
Once you have generated your tiles there are all sorts of things you could do with them. The demo shows off an attractive way of coloring them using three of my color nodes:
- werner_color. Produces a base palette of natural hues
- palette. Extends that palette across a colorspace to produces as many shades as you need
- fast_gradient. Applies a simple gradient to each cell
As you can see, the demo is very simple (only 7 nodes) yet produces a sophisticated design.
Comments welcome! Enjoy.