#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/convex_hull_3.h>
typedef Mesh::Vertex_index vertex_descriptor;
typedef Mesh::Face_index face_descriptor;
int main()
{
Mesh m;
vertex_descriptor v0 = m.
add_vertex(K::Point_3(0,0,0));
vertex_descriptor v1 = m.add_vertex(K::Point_3(1,0,0));
vertex_descriptor v2 = m.add_vertex(K::Point_3(0,1,0));
vertex_descriptor v3 = m.add_vertex(K::Point_3(0,0,1));
face_descriptor fd = m.add_face(v0, v1, v2);
m.add_face(v1, v0, v3);
for(vertex_descriptor vd : vertices_around_face(m.halfedge(fd), m)){
std ::cout << m.point(vd) << std::endl;
}
for( const K::Point_3& p : m.points()){
std::cout << p << std::endl;
}
Mesh ch;
return 0;
}
This class is a data structure that can be used as halfedge data structure or polyhedral surface.
Definition: Surface_mesh.h:335
Vertex_index add_vertex()
adds a new vertex, and resizes vertex properties if necessary.
Definition: Surface_mesh.h:979
void convex_hull_3(InputIterator first, InputIterator last, PolygonMesh &pm, const Traits &ch_traits=Default_traits)