Пример #1
0
void ShereMesh() {
  Tr tr;            // 3D-Delaunay triangulation
  C2t3 c2t3 (tr);   // 2D-complex in 3D-Delaunay triangulation

  // defining the surface
  Surface_3 surface(sphere_function,             // pointer to function
                    Sphere_3(CGAL::ORIGIN, 2.)); // bounding sphere
  // Note that "2." above is the *squared* radius of the bounding sphere!

  // defining meshing criteria
  CGAL::Surface_mesh_default_criteria_3<Tr> criteria(30.,  // angular bound
                                                     0.1,  // radius bound
                                                     0.1); // distance bound
  // meshing surface
  CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());

  std::cout << "Final number of points: " << tr.number_of_vertices() << "\n";

  //Output mesh
  //Polyhedron polymesh;
  //bool result = CGAL::output_surface_facets_to_polyhedron(c2t3, polymesh);
  //std::cout << "output_surface_facets_to_polyhedron: " << result << "\n";

  //Scommentare per salvare mesh su file
  std::ofstream out("mesh_sphere_test_low.off");
  CGAL::output_surface_facets_to_off (out, c2t3);
  std::cout << "SAVED MESH\n";

  //std::list<TriangleGT> triangleMesh;
  //std::back_insert_iterator<std::list<TriangleGT> > bii(triangleMesh);
  //output_surface_facets_to_triangle_soup(c2t3, bii);
}
Пример #2
0
 Sphere_3 operator()(const Point_3& , FT ){return Sphere_3();}