Subject: CGAL users discussion list
List archive
- From: "Santosh Tiwari" <>
- To: <>
- Subject: RE: [cgal-discuss] CGAL (need help writing the facets to a file)
- Date: Sun, 9 Mar 2008 16:37:22 -0400
- Organization: Clemson University
I had to modify the code as suggested in the previous mail to get the
correct list of vertices.
x1 = (*(iter->first->vertex((iter->second+1)%4))).point().x();
y1 = (*(iter->first->vertex((iter->second+1)%4))).point().y();
z1 = (*(iter->first->vertex((iter->second+1)%4))).point().z();
x2 = (*(iter->first->vertex((iter->second+2)%4))).point().x();
y2 = (*(iter->first->vertex((iter->second+2)%4))).point().y();
z2 = (*(iter->first->vertex((iter->second+2)%4))).point().z();
x3 = (*(iter->first->vertex((iter->second+3)%4))).point().x();
y3 = (*(iter->first->vertex((iter->second+3)%4))).point().y();
z3 = (*(iter->first->vertex((iter->second+3)%4))).point().z();
I have a few questions.
How do I know what is the correct CCW direction for the nodes, such that the
facet normal points outside?
Some of the triangles seem wrong (I can post the snapshot of the original
object and the obtained object if desired).
Thanks again.
__
Santosh Tiwari
EIB-326 Clemson University
http://www.clemson.edu/~stiwari/
-----Original Message-----
From: Santosh Tiwari
[mailto:]
Sent: Sunday, March 09, 2008 3:43 PM
To:
Subject: RE: [cgal-discuss] CGAL (need help writing the facets to a file)
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
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- CGAL (need help writing the facets to a file), Santosh Tiwari, 03/09/2008
- Re: [cgal-discuss] CGAL (need help writing the facets to a file), Manuel Caroli, 03/09/2008
- RE: [cgal-discuss] CGAL (need help writing the facets to a file), Santosh Tiwari, 03/09/2008
- RE: [cgal-discuss] CGAL (need help writing the facets to a file), Santosh Tiwari, 03/09/2008
- CGAL (Error message), Santosh Tiwari, 03/10/2008
- Re: [cgal-discuss] CGAL (need help writing the facets to a file), Andreas Fabri, 03/10/2008
- RE: [cgal-discuss] CGAL (need help writing the facets to a file), Santosh Tiwari, 03/13/2008
- CGAL (need suggestion for surface mesh refinement), Santosh Tiwari, 03/13/2008
- RE: [cgal-discuss] CGAL (need help writing the facets to a file), Santosh Tiwari, 03/09/2008
- RE: [cgal-discuss] CGAL (need help writing the facets to a file), Santosh Tiwari, 03/09/2008
- Re: [cgal-discuss] CGAL (need help writing the facets to a file), Manuel Caroli, 03/09/2008
Archive powered by MHonArc 2.6.16.