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§
- ConnectorID
- A connector is a unique identifier for a specific image and direction.
- Wave
- Wave holds the state of a wave collapse function.
Enums§
- Direction
- Represents each of the sides of the image.
Traits§
Functions§
- get_
constraint_ fn - Returns the default constraint function.
The constraint function is used to calculate the
connectorID
for a slot. Only modules that have the sameconnector
as the slot’s module are considered possible. The default constraint function checks pixel equality. Use thesample_size
to control the number of pixels to compare on each side of the slot.