Commit fc67bf6a authored by Deepak Rangarajan's avatar Deepak Rangarajan
Browse files

Use a fixed seed when generating hull

parent 346df8b4
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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));