simple_wfc 0.1.0-alpha.7

A simple implementation of wave-function collapse for procedural generation
Documentation

Simple WFC

Crates.io docs.rs

This crate is a simple implementation of Wave Function Collapse a.k.a. Model Synthesis.

Features

  • 2D
  • 3D
  • Custom collapse order
  • Periodic coordinate wrapping
  • Determinism (via custom rand::Rng)
  • Simple tiles
  • Overlapping tiles
    • Custom pattern size
    • Custom symmetry
  • Error reporting

Example (3x3 overlapping patterns)

____________________
__+---+__+---+______
__|+++|__|***|______
__|+++|__|***+---+__
__|+++|__|*******|__
__|+++|__|*******|__
__|+++|__|*******|__
__+---+__+-------+__
____________________
__________________________________________________
__________________________________________________
_+---+_________________________________+--+_______
_|***|______+-----+______+---------+___|**|_______
_|***|______|+++++|______|*********|___|**+----+__
_|***|______|+++++|______|*********|___|*******|__
_|***|______+-----+______+--+******|___|*******|__
_|***|______________________|******|___+-------+__
_+---+______________________+------+______________
_________+-----------+____________________________
_________|***********|_____________________+---+__
_+-------+***********|_____________+---+___|***|__
_|**************+----+_____+--+____|***|___|***|__
_|**************|__________|**|____|***|___|***|__
_+--------------+__________|**|____|***|___|***|__
____________________+---+__|**|____+---+___+---+__
____________________|***|__|**|___________________
____________________|***|__|**|___________________
____________________+---+__+--+___________________
__________________________________________________

Acknowledgements

This is a simplified and extended fork of kahuna.

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.