Try the interactive simulation in your web browser: Live Demo
This is a program that simulates the growth of snow crystals. It is written in Rust and operates in a multi-threaded environment. Bevy is used for visualization.
The simulation algorithm implements the one described in reference [1]. While parameters can be dynamically changed during execution, ρ (water vapor density) is only reflected upon reset.
By toggling the comments on L.19 and L.20 in main.rs, you can switch to an implementation using the method from reference [2]. In this case, β (water vapor density) is also only reflected upon reset.
This project is compatible with web browsers when compiled to WebAssembly (requires the nightly version of Rust).
For more details, check out the Zenn article (in Japanese).
cargo run --release
- Build the WebAssembly package:
rustup run nightly wasm-pack build --target web --release
- When hosting the web version, your server needs to set the following Cross-Origin headers:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
These headers (COOP/COEP) are required for the application to function properly in web browsers.
You can export STL file by pressing "Save STL" button on the control panel. The exported file will be placed in your working directory.
- Gravner, J., Griffeath, D. (2008). Modeling snow crystal growth II: A mesoscopic lattice map with plausible dynamics. Physica D: Nonlinear Phenomena, 237(3), 385-404.
- Reiter, C. A. (2005). A local cellular model for snow crystal growth. Chaos, Solitons & Fractals, 23(4), 1111-1119.