Skip to main content

cluster_collapse

Function cluster_collapse 

Source
pub fn cluster_collapse(mesh: &mut Mesh, cell: f32) -> usize
Expand description

Snap all vertices onto a grid of cell meters, merge each cluster to its centroid and rebuild the triangle list. Degenerate (collapsed) and duplicate triangles are dropped; UVs are averaged per cluster; skin data is removed (callers should refuse skinned meshes explicitly).

Returns the new triangle count.