4.3Intertwining analysis
A simplistic 2D WFC algorithm implementation in practice
Now that we have seen how WFC works, we will take a look at how it can be used to generate more complex structures. Below is an example of a room generated using WFC.
Compared to the previous example, this room is more complex and has more tiles. The tiles are more varied and the room is more organic, which si possible by assigning more rules for connections between tiles. Prevously the sand tiles could connect with the land tiles from pretty much every direction. Now, the walls can connect with different wall tiles only from specific direction, matching the architectual constraints of the room.
The 3D models below are placed withing the tiles to provide a more visual representation of the room and allow analysis. The connecting lines are used to transfer the rules from the WFC grid using a custom script.

You can get started by opening the Grasshopper file below:
Ensure you have Rhino 8+ installed, there are no Third party dependencies.
Analysis
The file was set to run a sunlight hours analysis for the early hours of the day, beteen 10am and 12pm. You can change the seed and see how the acompunded score changes, in order to manually find the best option.
