#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/Complex_2_in_triangulation_3.h>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Implicit_surface_3.h>
#include <CGAL/IO/facets_in_complex_2_to_triangle_mesh.h>
#include <CGAL/Surface_mesh.h>
#include <fstream>
typedef CGAL::Complex_2_in_triangulation_3<Tr> C2t3;
typedef Tr::Geom_traits GT;
typedef GT::Sphere_3 Sphere_3;
typedef GT::Point_3 Point_3;
typedef GT::FT FT;
typedef FT (*Function)(Point_3);
typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
FT sphere_function (Point_3 p) {
const FT x2=p.x()*p.x(), y2=p.y()*p.y(), z2=p.z()*p.z();
return x2+y2+z2-1;
}
int main() {
Tr tr;
C2t3 c2t3 (tr);
0.1,
0.1);
Surface_mesh sm;
std::ofstream out("sphere.off");
out << sm << std::endl;
std::cout << "Final number of points: " << tr.number_of_vertices() << "\n";
}
The class Implicit_surface_3 implements a surface described as the zero level set of a function .
Definition: Implicit_surface_3.h:39
The class Surface_mesh_default_criteria_3 implements the most commonly used combination of meshing cr...
Definition: Surface_mesh_default_criteria_3.h:36
The class Surface_mesh_default_triangulation_3 is a model of the concept SurfaceMeshTriangulation_3,...
Definition: Surface_mesh_default_triangulation_3.h:20
The concept Surface_3 describes the types of surfaces to be meshed. The surface types are required to...
Definition: Surface_3.h:19
void facets_in_complex_2_to_triangle_mesh(const C2T3 &c2t3, TriangleMesh &graph)
converts a manifold surface reconstructed by make_surface_mesh() to a TriangleMesh.
void make_surface_mesh(SurfaceMeshC2T3 &c2t3, Surface surface, FacetsCriteria criteria, Tag tag, int initial_number_of_points=20)
In the first overloaded version of of make_surface_mesh(), the surface type is given as template para...
const CGAL::Origin ORIGIN
The class Non_manifold_tag is a tag class used to monitor the surface meshing algorithm.
Definition: make_surface_mesh.h:205