| Crates.io | cytogon |
| lib.rs | cytogon |
| version | 0.1.0 |
| created_at | 2024-12-30 18:42:17.257789+00 |
| updated_at | 2024-12-30 18:42:17.257789+00 |
| description | Mesh generation library based on cellular automata |
| homepage | https://github.com/djeedai/cytogon |
| repository | https://github.com/djeedai/cytogon |
| max_upload_size | |
| id | 1499363 |
| size | 57,680 |
🦠Cytogon — A mesh generation library based on cellular automata.
🦠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).