CGAL: Read vertices and triangles from mesh
<p>I just spend few hours with CGAL in Visual Studio C++ trying to understand how meshes work. What I want to get is an access to list of vertices and triangles (vertices in form of double[3], triangles in form of int[3]). Here is the script I am working on:</p>

<p><a href="http://doc.cgal.org/latest/Surface_mesher/Surface_mesher_2mesh_a_3d_gray_image_8cpp-example.html" rel="nofollow">http://doc.cgal.org/latest/Surface_mesher/Surface_mesher_2mesh_a_3d_gray_image_8cpp-example.html</a></p>

<p>The point is - function <code>CGAL::output_surface_facets_to_off (out, c2t3);</code> outputs me a nice file in .off format (accessible by MeshLab), but I CAN'T DO ANY SIMILAR just by manipulating a <code>c2t3</code> or <code>tr</code> variable. What I was expecting was something like:</p>

<p>c2t3.vertices (from 0 to N), and c2t3.triangles (from 0 to M) with values of triple of integers. What I've got was list of vertices, list of facets, list of cells, list of edges... and no way to get vertices numbers from facets any other way than finding for every vertice number in nonsorted list of vertices.</p>

<p>Can anybody solve my problem and point what I am doing wrong? Also, API of CGAL is very... raw. Digging with source was also very hardcore - so much I couldn't find output_surface function body.</p>