Go back

Monoceros

A Wave Function Collapse Solver and Grasshopper plugin

In 2020, Subdigital hosted a summer internship with the aim to develop and utilize a discrete materialization method of data-driven design with available fabrication technology. We picked Wave Function Collapse - a method already well known in the game development community thanks to people like Maxim Gumin and Oskar Stålberg, but still somewhat under-exploited at the time in the fields of computational design and architecture.

Ján Pernecký and I created the software tools necessary for the internship students to experiment with the method. We opted to make the WFC solver a plugin for Grasshopper, an node based programming language for computationally creating shapes and forms.

That initial summer exploration was later expanded on. Driven by usage experience and over the course of many observations, Ján Pernecký collapsed his original WFC tools into Monoceros, a full fledged Grasshopper plugin.

While my own work on Monoceros amounted to mostly brainstorming and rubber-ducking, I am glad it still uses the original solver from the summer because of the optimization work that went into it. To enable fast iteration for designers, we knew the tool needed to respond to parameter changes quickly, ideally real-time. The heavy lifting is therefore implemented in Rust and loaded into Grasshopper as a DLL. Inside the library itself, WFC slots and the modules they contained were represented as compact bit vectors of 256 bits and operated on by just a handful of bitwise instructions and bit-counting intrinsics. While initially worried about the 256 limit on the WFC module count, the projects rarely reach this limit in practice. A future extension might be to fall back to a less compact (and therefore possibly slower) representation for definitions with large module counts.

Bonn voids, designed with Monoceros; picture courtesy of Ján Pernecký & Subdigital