Multi Scale Truchet Tiling

In the last week or so I have been endeavoring to build a multi scale Truchet tiling system based on a few papers and articles found online. Truchet tiles are tiles that seem to fit together nicely when placed randomly. This work is largely inspired by work seen on twitter by @theo_coding_art. While I read a few papers, I tried to implement as much of it as possible without using already built solutions/code, and tried to make most of my tiles different from what I had seen before. It came out pretty good overall, but I had a few troubles along the way.

The overall process for my “algorithm” is to choose a tile size, check if the tile can fit, and place the tile if it can. My code consists of two arrays that are needed to function. One stores instances of tile objects, and the other stores information about what cells have been filled already. When beginning, I had a wonderful idea to store the positional information in a singular dimensional array. I think this code would have been more efficient, but I couldn’t get it working with any more than a scale of two, so that idea was scrapped in favor of a two dimensional array storing the information of filled or not filled. Below are some images from when the algorithm was just barely not working. I think it led to some interesting results, although they bug the heck out of me at the overlaps.

Once changing the array to a two dimensional version, and adding another loop inside of a loop, I got the system working, although I would love to optimize performance and refactor the class to make more sense. I would also love to delve into a version that places tiles randomly instead of from left to right, top to bottom. The images with the colored squares were a “debug view” that helped me follow along with how everything was flowing to get the kinks worked out. In the end I really like that, so I’m going to keep this version up with those intact, and work on some other versions with better tiles. I did make a bunch of tiles, but they do not all work well together. Here are some images:

All of the code can be found on open processing, a website I enjoy very much.
Multi Scale Truchet by Robert Houston

Inspiration/ references:
https://twitter.com/theo_coding_art
https://christophercarlson.com/portfolio/multi-scale-truchet-patterns/
https://archive.bridgesmathart.org/2018/bridges2018-39.pdf
https://observablehq.com/@osteele/truchet-carlson-tiles

Overall this is a great system to play with. I enjoyed the heck out of learning more about how tiling systems work, and I look forward to implementing them in many different works in the future. I would like to port a similar system to geometry nodes in a unique way.

Below are a few images from a revised version of the system that works with more than just square canvas’s

Posted in