Search code examples
iterationcgaldelaunay

CGAL 3D Delaunay Triangulation - First Vertex is Origin?


I am performing a 3D Delaunay Triangulation of points sampled from a sphere, and I am looking at the vertices of the resultant triangulation essentially by doing this:

for(Delaunay_Vertex_iter p = T.vertices_begin(); p != T.vertices_end(); p++){

std::cout << p->point() << endl;

}

While T.number_of_vertices() == 270, I get 271 vertices, the first one being the origin (0, 0, 0). Why?


Solution

  • This is the infinite vertex, which has unspecified coordinates and happens to be the origin here. You should iterate using finite_vertices_begin()/finite_vertices_end() instead. See http://doc.cgal.org/latest/Triangulation_3/ for information about the infinite vertex.