Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] How to extract faces from a CDT? examples/Mesh_2/mesh_global.cpp

Subject: CGAL users discussion list

List archive

[cgal-discuss] How to extract faces from a CDT? examples/Mesh_2/mesh_global.cpp


Chronological Thread 
  • From: Alejandro Aguilar Sierra <>
  • To:
  • Subject: [cgal-discuss] How to extract faces from a CDT? examples/Mesh_2/mesh_global.cpp
  • Date: Tue, 6 Oct 2009 23:56:06 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Vy80XbG3LzseXmdTI4i3wqvo8vyp+2sZ3BZ0peSpQ2KNLLZ1JL+lzIdwUZWRv7Hyfr hNBoHHxx50/Ze9gPAKJR9f0kf3bzvGlHHYEU10g5sip5GAfTfLK18FYfBk1CwluUVKJ9 BVGLMoNJmj4B9YFyQw5wvA096Y7Atmo2OM8Yk=

Hello:

I am studyng example examples/Mesh_2/mesh_global.cpp. The last line
prints the number of vertices.

std::cout << "Number of vertices: " << cdt.number_of_vertices() << std::endl;

I want to print instead the vertices and then the faces, so I can draw
the mesh with any mesh viewer. Actually I am trying to create an OBJ
file.

First I print the vertices

for (CDT::Vertex_iterator vit = cdt.vertices_begin(); vit!=
cdt.vertices_end(); ++vit) {
std::cout << "v " << (*vit) << " 0" << std::endl;
}

Now I want to print the faces, but just the individual faces prints nothing.

for (CDT::Face_iterator fit = cdt.faces_begin(); fit!=
cdt.faces_end(); ++fit) {
std::cout << "f " << (*fit) << std::endl;
}

Yes I am looking and trying, but no success so far.

How can I get the vertices information from the faces?

Any hint?

Regards,

--
Alejandro Sierra



Archive powered by MHonArc 2.6.16.

Top of Page