Generating Elementary Cellular Automata SVG designs using Marching Squares


https://jakebeamish.github.io/ECAMS.js/

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:
A second order elementary cellular automata fed into a squaremarching algorithm to create paths that are drawn by a pen plotter

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.


Action Keyboard shortcut
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 t2. o
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 1) i
Change the proportion of cells that will be randomly set to 1 , .
Download SVG d

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.


TODO


Updated 2024-01-02