Skip to content
/ wfc Public

An implementation of Wave Function Collapse that works in any dimension

Notifications You must be signed in to change notification settings

llGaetanll/wfc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wave Function Collapse

An implementation of the Wave Function Collapse algorithm written in Rust. This implementation strives to be as general as possible while staying as fast as possible.

Notable Features

  • Works in any dimension from 1-6
  • Works on any type which implements WaveTileable
  • Wave can be collapsed in parallel for types which are also Send and Sync

Feature Flags

The crate comes with a set of useful (and common) features that deal with wave function collapse.

  • image (default) Allows the user to easily crate and collapse Waves of images.
  • parallel (default) Allows the user to collapse a Wave in parallel for types which are Send and Sync.
  • wrapping Allows the user to create a wrapping Wave. Currently, supported wrapping modes are
    • Torus
    • ProjectivePlane
    • KleinBottle

Getting Started

The following command runs the image example, with the rooms.png sample on a tiling window of sidelength 3.

cargo run --release --example image -- ./examples/image/samples/rooms.png 3

About

An implementation of Wave Function Collapse that works in any dimension

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages