cytogon

Crates.iocytogon
lib.rscytogon
version0.1.0
created_at2024-12-30 18:42:17.257789+00
updated_at2024-12-30 18:42:17.257789+00
descriptionMesh generation library based on cellular automata
homepagehttps://github.com/djeedai/cytogon
repositoryhttps://github.com/djeedai/cytogon
max_upload_size
id1499363
size57,680
Jerome Humbert (djeedai)

documentation

https://docs.rs/cytogon

README

🦠 Cytogon

License: MIT or Apache 2.0 Doc Crate

🦠 Cytogon — A mesh generation library based on cellular automata.

Overview

🦠 Cytogon allows generating 2D and 3D meshes from cellular automata.

// Create a 128³ grid and randomly fill it at 60%
let mut cave = Grid3::new(UVec3::new(128, 128, 128));
cave.fill_rand(0.6, rand::thread_rng());

// CA rule: 13-26/13-14,17-19/2/M
let rule = Rule3 {
    birth: RuleBitset3::from(13u8..=14u8) | (17u8..=19u8).into(),
    survive: (13u8..=26u8).into(),
};

// Iteratively apply the cellular automaton rule 5 times
for _ in 0..5 {
    cave.smooth(&rule);
}

For a viewer (GUI), see the 🔬 μscope repository (📦uscope crate).

Commit count: 22

cargo fmt