From 9b761d3a6f8b94e47c4c39ad60f69be771a91f77 Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Thu, 2 Jun 2022 15:29:42 +0200 Subject: [PATCH] fix random generator in short edge collpase, so that results are deterministic --- src/libslic3r/ShortEdgeCollapse.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libslic3r/ShortEdgeCollapse.cpp b/src/libslic3r/ShortEdgeCollapse.cpp index 897b57759..85d776843 100644 --- a/src/libslic3r/ShortEdgeCollapse.cpp +++ b/src/libslic3r/ShortEdgeCollapse.cpp @@ -18,8 +18,7 @@ void its_short_edge_collpase(indexed_triangle_set &mesh, size_t target_triangle_ std::vector vertex_normals; // Vertex normal in this algorithm is normal of any! triangle that contains the vertex std::vector face_indices; //vector if indices, serves only the purpose of randomised traversal of the faces - std::random_device rd; - std::mt19937 generator(rd()); + std::mt19937_64 generator { }; float decimation_ratio = 1.0f; // decimation ratio updated in each iteration. it is number of removed triangles / number of all float edge_size = 0.2f; // Allowed collapsible edge size. Starts low, but is gradually increased