Late in 2021 I became interested in algorithmically generated geometric art. I decided to attempt my own both as a learning experience, and to brush up on my Python. For this project I opted to pursue a fairly simple output leaning primarily on Truchet tiles, as opposed to something more complex like flow field generation. Truchet tiles are square tiles filled with patterns that are not rotationally symmetric, yet can generate interconnecting patterns when combined, no matter the order or orientation. Below is the high-level logic used for this project:
To begin, we randomly pick a color palette and line thickness. With these variables defined, we proceed to generate 6 unique tiles, split into 3 categories:
Perimeter pieces - tiles used to line the perimeter of the image and ensure the paths are always fully connected
Radial pieces - tiles with two quarter circles per square. Each quarter has a randomly generated color assigned to it (within a defined color palette). More commonly known as "Smith" pieces
Cross pieces - tiles with two perpendicular bars per square. Each bar has a randomly generated color assigned to it (within a defined color palette)
The program then randomly picks a grid size for compiling the final image. It iterates through each grid location (with special rules for the perimeters), and fills out the squares with a randomly selected (Radial and Cross pieces only) and randomly rotated piece (within 90 degree intervals)
After filling out the entire grid, we are left with our final image! Additional outputs are included below as examples