Generating Elementary Cellular Automata SVG designs using Marching Squares
This is a small web application I've made for generating line-based images of Elementary Cellular Automata using Marching Squares.
This is how it looks at the minute:
The image is drawn using p5.js, and can be downloaded as an SVG (made using Zenozeng's p5.js-svg runtime).
It has a simple dat.GUI interface and some keyboard shortcuts for interacting with the app.
Some controls are self-explanatory. Size settings allow for adjusting the size of the grid of cells, and the size of an individual cell. Draw settings can be used to toggle the Marching Squares algorithm, or to draw cells as points or shapes. 'Setup' controls require a bit of explanation.
|Change the Seed number for the PRNG that can be used to determine the initial cell states.
|s (Chooses a random new seed)
|Toggle the second-order option to XOR the current cell state with it's state at
|Rotate the grid of cells left or right. The left edge wraps to the right and vice versa.
|Scroll through further iterations.
|Toggle initial cell states between Impulse (only the centre cell is set to
1) and Random (set a randomly distributed proportion of cells to
|Change the proportion of cells that will be randomly set to
After downloading an image, I use
vpype to optimise the file with line merging and sorting, and then plot it out using the Inkscape AxiDraw plugin.
- Implement dark mode
- Intefere with the marching squares
- Clean up the code (...)