I wasn't quite happy with last post's demo, as it felt algorithmically unclean. It used some cellular automaton ideas without a common lattice of cells, and also relied on some "hidden variables" to define the seed points and directions. So here's a better cellular automaton approach to the same problem:
(a) An empty cell becomes full if it has exactly one full neighbour, and a full second-level neighbour behind that. (The number of second-level neighbours is not otherwise limited.)
(b) Otherwise, empty cells stay empty and full ones stay full.
These are enough to grow lines from initial line segments, until they reach another line. But for my general seed images I added one more rule:
(c) A full cell with no full neighbours, or more than 2 full neighbours, becomes empty. This is meant to break up formations that are not clean lines.
The same rules work in a hexagonal lattice, so I'm also showing that besides the usual rectangular one (that uses the Moore neighbourhood). Finally, there's an RGB overlay version using a seed photo, where each colour channel runs independently. All of these are cleaned up with my line-joining postprocessor.
The hatching patterns that formed with general seeds were a bit surprising; the way they grow remind me of gliders in Conway's Game of Life. I didn't expect such nice dynamics as I was only aiming for clean, static line patterns.
#gilberttessellation #cellularautomaton #gameoflife #crackformation #crackmodel #mudcracks #pythoncode #opengl #algorithmicart #algorist #computerart #ittaide #kuavataide #iterati
Ещё видео!