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: "Santosh Tiwari" <>
  • To: <>
  • Subject: RE: [cgal-discuss] CGAL (need help writing the facets to a file)
  • Date: Sun, 9 Mar 2008 15:42:30 -0400
  • Organization: Clemson University

Thanks a lot.

I am able to write the facets now. I am using the following code snippet.

//write the facets;
list<Facet> facets;
as.get_alpha_shape_facets(back_inserter(facets),
Alpha_shape_3::REGULAR);
cout<<facets.size()<<" boundary facets \n";
int numFacets = 0;
for(list<Facet>::const_iterator iter = facets.begin();
iter!=facets.end(); ++iter) {
cout<<"Facet "<<++numFacets<<endl;
cout<<(*(iter->first->vertex(1))).point()<<", ";
cout<<(*(iter->first->vertex(2))).point()<<", ";
cout<<(*(iter->first->vertex(3))).point()<<endl;
}

Thanks again. :)

__
Santosh Tiwari




-----Original Message-----
From: Manuel Caroli
[mailto:]

Sent: Sunday, March 09, 2008 6:44 AM
To:

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

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/Chapte
r_main.html
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/TriangulationDS_3_ref/Co
ncept_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
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss




Archive powered by MHonArc 2.6.16.

Top of Page