diff --git a/src/csg/cgal_helper_polyhedron.cpp b/src/csg/cgal_helper_polyhedron.cpp index 1fa87b37084f75f9d77da158f9a0b9d55ac1ac46..ea2735b4818f61587ac24422da42df444ac11439 100644 --- a/src/csg/cgal_helper_polyhedron.cpp +++ b/src/csg/cgal_helper_polyhedron.cpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace { @@ -110,11 +111,14 @@ create_polyhedron_from_hull(const std::tuple &cube_size, auto p = std::make_shared(); + // Use a fixed seed random function to ensure reproducibility + auto rand = CGAL::Random(0); + std::list points; - CGAL::Random_points_on_sphere_3 s(sphere_radius); + CGAL::Random_points_on_sphere_3 s(sphere_radius, rand); std::copy_n(s, NUM_SAMPLING_PTS, std::back_inserter(points)); - CGAL::Random_points_in_cube_3 c(1.0); + CGAL::Random_points_in_cube_3 c(1.0, rand); std::list points_c; std::copy_n(c, NUM_SAMPLING_PTS, std::back_inserter(points_c));