Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Newbie questions concerning Delaunay_triangulation_3

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Newbie questions concerning Delaunay_triangulation_3


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Cc:
  • Subject: Re: [cgal-discuss] Newbie questions concerning Delaunay_triangulation_3
  • Date: Fri, 15 Jun 2007 11:16:32 +0200


wrote:
Dear List,

I have recently downloaded and installed CGAL and have run into a minor problem. When I run the attached code, the finite cells include the point (0.5,0.5,0.5), which I have not entered. I only want a delaunay triangulation of the points I have entered. I have tried to remove that point, which corresponds to vertices_begin(), but that results in an exception.

Christopher,

As a newbie you probably have to read the user manual first.
CGAL triangulates the interir of the convex hull of your input
points, AND it also triangulates the unbounded space outside
the convex hull. Each of those cells has three vertices on
the convex hull and as fourth an "infinite vertex".
The triangulation has a member function to test whether a
vertex is the infinite one.

best regards,

andreas


Secondly, is there a structure or method that allows me access to the list of cells of which a given vertex is a member? The documentation of cell() for a vertex has suggested no obvious way to me.

Christopher

PS: Is there a complete class hierarchy diagram for CGAL in the documentation? I haven't come across one so far.

--
C. Rinderspacher, Ph. D.
Duke University
Dept. of Chemistry
Box 97
Durham, NC 27705
Tel.: (919) 660-1633
E-Mail:


The faults of the burglar are the qualities of the financier.
George Bernard Shaw-- You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss


------------------------------------------------------------------------

#include <iostream>
#include <CGAL/basic.h>
#include <CGAL/Delaunay_triangulation_3.h>

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Point_3.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Delaunay_triangulation_3<Kernel> Triangulation;
typedef Triangulation::Point Point_3;
typedef Triangulation::Cell_iterator Cell_iterator;
typedef Triangulation::Vertex_iterator Vertex_iterator;
//typedef CGAL::Point_3 Point_3;

using namespace std;

main()
{
vector<Point_3> L;
L.push_back(Point_3(0.0,-0.1200944034,0.0));
L.push_back(Point_3(-1.4301799859,0.9529926662, 0.0000000000 ));
L.push_back(Point_3( 1.4301799859,0.9529926662, 0.0000000000 ));
L.push_back(Point_3(-1.4301799859,0.9529926662, 1.0000000000 ));
L.push_back(Point_3( 1.4301799859,0.9529926662,-1.2000000000 ));
L.push_back(Point_3( 1.4301799859,0.9529,-1.000000000 ));
Triangulation td(L.begin(),L.end());
Cell_iterator Cell;
/*
td.insert(Point_3(0.0,-0.1200944034,0.0));
td.insert(Point_3(-1.4301799859,0.9529926662, 0.0000000000 ));
td.insert(Point_3( 1.4301799859,0.9529926662, 0.0000000000 ));
td.insert(Point_3(-1.4301799859,0.9529926662, 1.0000000000 ));
td.insert(Point_3( 1.4301799859,0.9529926662,-1.2000000000 ));*/
Vertex_iterator Vertex=td.vertices_begin();
// td.remove(td.vertex(1));
Vertex=td.finite_vertices_begin();
int k=0;
while(Vertex != td.vertices_end()) {
cout << " Vertex : " << k++ << endl;
cout << "X : " << Vertex->point().x() <<" Y : " << Vertex->point().y() <<" Z : "
<< Vertex->point().z() << endl;
Cell=Vertex->cell();
// td.index(Cell);
Vertex++;
}
int noc=td.number_of_finite_cells();
cout << "\n Number of cells : " << noc;
cout << "\n Number of facets : " << td.number_of_finite_facets();
cout << "\n Number of edges : " << td.number_of_finite_edges();
cout << "\n Number of vertices : " << td.number_of_vertices() << endl;
Cell=td.finite_cells_begin();
for(int i=0;i<noc;i++, Cell++)
{
cout << "Cell " << i << " : \n";
for(int j=0;j<4;j++)
cout << "X : " << Cell->vertex(j)->point().x() << " Y : " << Cell->vertex(j)->point().y() <<
" Z : " << Cell->vertex(j)->point().z() << endl;
}
}




Archive powered by MHonArc 2.6.16.

Top of Page