Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL (need help writing the facets to a file)

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL (need help writing the facets to a file)


Chronological Thread 
  • From: Manuel Caroli <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL (need help writing the facets to a file)
  • Date: Sun, 09 Mar 2008 11:44:24 +0100

Hi Santosh,

Santosh Tiwari wrote:
Hello,

I am learning to use CGAL.

I want to output the vertices of a list of Facets on the screen. How do I do
it?

Any help or references would be appreciated. Following is the code snippet,
I am using.
The triangulation data structure stores facets only implicitly:
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/TriangulationDS_3/Chapter_main.html
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/TriangulationDS_3_ref/Concept_TriangulationDataStructure_3.html

Short explanation:
A facet is represented as a pair of a Cell_handle ch of a cell to which the facet is incident and an int i such that ch->vertex(i) gives you the only vertex that is not incident to the facet (the opposite vertex).
To output the all vertices of the facet f you could do something like
std::cout<<f.first->vertex((f.second+1)%4)<<", "
<<f.first->vertex((f.second+2)%4)<<", "
<<f.first->vertex((f.second+3)%4)<<std::endl;

Best

Manuel



Archive powered by MHonArc 2.6.16.

Top of Page