[−][src]Function building_blocks_mesh::height_map::triangulate_height_map
pub fn triangulate_height_map<V, H>(
height_map: &V,
extent: &Extent2i,
output: &mut HeightMapMeshBuffer
) where
V: Array<[i32; 2]> + GetUncheckedRelease<Stride, H> + ForEach<[i32; 2], (Point2i, Stride), Data = H>,
H: Height,
Generates a mesh with a vertex at each point on the interior of extent
. Surface normals are
estimated using central differencing, which requires each vertex to have a complete Von Neumann
neighborhood. This means that points on the boundary of extent
are not eligible as mesh
vertices, but they are still required.
This is illustrated in the ASCII art below, where "b" is a boundary point and "i" is an interior point. Line segments denote the edges of the mesh.
b b b b
b i - i b
| / |
b i - i b
b b b b