Expand description
Implementation of the wave function collapse algorithm based on Oskar Stålberg’s.
The wave function collapse algorithm is a recursive algorithm that picks a random tile for a slot on the output image and removes impossible neighbors until only a single possibility remains
Modules
Structs
A connector is a unique identifier for a specific image and direction.
Wave holds the state of a wave collapse function.
Enums
Represents each of the sides of the image.
Traits
Functions
Returns the default constraint function.
The constraint function is used to calculate the connectorID
for a slot.
Only modules that have the same connector
as the slot’s module are considered possible.
The default constraint function checks pixel equality.
Use the sample_size
to control the number of pixels to compare on each side of the slot.