mesh_generation/
lib.rs

1//! Based on [this guide](https://www.scratchapixel.com/lessons/procedural-generation-virtual-worlds/perlin-noise-part-2)
2
3//! # Examples
4//!
5//! ```
6//! use mesh_generation::mesh::PolyMesh;
7//! use noise::{Perlin, Seedable};
8//! 
9//! let perlin = Perlin::new();
10//! perlin.set_seed(1564863213);
11//! let mut mesh = PolyMesh::new(Some(128), Some(128), Some(10), Some(10));
12//! let width = 128;
13//! let height = 128;
14//! let noise_map = mesh::generate_noise_map(perlin, width, height, 128.0, 5);
15//! mesh.displace_with_noise_map(noise_map, width, height);
16//! mesh.calculate_normals();
17//! mesh.export_to_obj("./poly_mesh.obj");
18//! ```
19
20mod mesh;
21pub use crate::mesh::*;