Skip to content
Snippets Groups Projects
Commit fc67bf6a authored by Deepak Rangarajan's avatar Deepak Rangarajan
Browse files

Use a fixed seed when generating hull

parent 346df8b4
No related branches found
No related tags found
1 merge request!81Use a fixed seed when generating hull
Pipeline #27644 passed
......@@ -10,6 +10,7 @@
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/convex_hull_3.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/Random.h>
namespace {
......@@ -110,11 +111,14 @@ create_polyhedron_from_hull(const std::tuple<double, double, double> &cube_size,
auto p = std::make_shared<Polyhedron>();
// Use a fixed seed random function to ensure reproducibility
auto rand = CGAL::Random(0);
std::list<cgal_helper::CK::Point_3> points;
CGAL::Random_points_on_sphere_3<cgal_helper::CK::Point_3> s(sphere_radius);
CGAL::Random_points_on_sphere_3<cgal_helper::CK::Point_3> s(sphere_radius, rand);
std::copy_n(s, NUM_SAMPLING_PTS, std::back_inserter(points));
CGAL::Random_points_in_cube_3<cgal_helper::CK::Point_3> c(1.0);
CGAL::Random_points_in_cube_3<cgal_helper::CK::Point_3> c(1.0, rand);
std::list<cgal_helper::CK::Point_3> points_c;
std::copy_n(c, NUM_SAMPLING_PTS, std::back_inserter(points_c));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment