https://github.com/pudnax/dla-rust
Diffusion-limited aggregation on Rust
https://github.com/pudnax/dla-rust
diffusion-limited-aggregation rendering rust
Last synced: 5 months ago
JSON representation
Diffusion-limited aggregation on Rust
- Host: GitHub
- URL: https://github.com/pudnax/dla-rust
- Owner: pudnax
- Created: 2019-08-10T19:13:04.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-19T07:47:26.000Z (over 5 years ago)
- Last Synced: 2024-11-11T01:42:35.542Z (6 months ago)
- Topics: diffusion-limited-aggregation, rendering, rust
- Language: Rust
- Homepage:
- Size: 1.37 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dla-rust
[](https://travis-ci.com/disDeal/dla-rust)Algorithm taken from [Michael Fogelman's dlaf.](https://github.com/fogleman/dlaf)
### Usage```Rust
use dla::Builder;fn main() {
let mut model = Builder::flat();model.add([0., 0.].into(), 1);
for _ in 0..10000 {
model.add_particle();
}model.save_csv("out.csv").unwrap();
dla::Raycaster::flat(model.index)
.with_color(|_| [1., 1., 1.])
.render("render.png");
}```
### Output Formats
CSV
```bash
$ head output.csvindex,parent,x,y,z
0,9101,0.6332,181.0855,0.0000
1,9142,0.4418,182.0670,0.0000
2,9386,0.1673,183.9447,0.0000
3,9172,-0.0078,182.9602,0.0000
4,9199,-0.9820,183.1860,0.0000
```### Image
I'm using raycaster from repo: [Simple-raytraces](https://github.com/ebobby/simple-raytracer).


