diff --git a/lib/mittsu/mesh_analysis/modifiers/decimator.rb b/lib/mittsu/mesh_analysis/modifiers/decimator.rb index 2b1f303..958f313 100644 --- a/lib/mittsu/mesh_analysis/modifiers/decimator.rb +++ b/lib/mittsu/mesh_analysis/modifiers/decimator.rb @@ -11,9 +11,10 @@ def decimate(target_face_count, vertex_splits: false) loop do break if @geometry.faces.count <= target_face_count || edge_collapses.empty? edge = edge_collapses.shift - splits.unshift @geometry.collapse(edge[:edge_index]) + splits.unshift @geometry.collapse(edge[:edge_index], flatten: false) end # Return vertex splits if requested + @geometry.flatten! if vertex_splits [@geometry, splits.compact] else