title: How to use vertice's info with basic triangulation using CGAL
body: <p>I am triying to add an index info to vertices in a basic 2D triangulation using CGAL to make a .obj file, i have been searching many examples of this, but most of the cases are for Delaunay_triagnulation but i don't want that, i would like to have an example to basic 2D triangulations (Triangulation_2.h).
  My code is this:</p>
  
  <pre><code>#include &lt;CGAL/Exact_predicates_inexact_constructions_kernel.h&gt;
  #include &lt;CGAL/Triangulation_vertex_base_with_info_2.h&gt;
  #include &lt;CGAL/Triangulation_2.h&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;vector&gt;
  
  typedef unsigned int                    TIndex;
  typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
  typedef CGAL::Triangulation_vertex_base_with_info_2&lt;TIndex,Kernel&gt; Vb;
  typedef CGAL::Triangulation_data_structure_2&lt;Vb&gt;                      Tds;
  typedef CGAL::Triangulation_2&lt;Kernel,Tds&gt;      Triangulation;
  typedef Triangulation::Point          Point;
  typedef Triangulation::Finite_vertices_iterator Finite_vertices_iterator;
  typedef Triangulation::Finite_faces_iterator Finite_faces_iterator;
  
  
  int main()
  {
  
      std::string input="../input.txt";
      std::string output="../triangulation.obj";
      std::vector&lt;std::string&gt; colors;
  
      colors.push_back("red");
      colors.push_back("green");
      colors.push_back("blue");
      colors.push_back("black");
      colors.push_back("yellow");
      colors.push_back("purple");
  
      std::ifstream input_file;
      input_file.open(input);
  
      if(!input_file){
          std::cout &lt;&lt; "Cannot open file: " &lt;&lt; input &lt;&lt; std::endl;
          return 0;
      }
  
      std::vector&lt; std::pair&lt;Point,TIndex&gt;&gt; points;
  
      TIndex n;
      input_file &gt;&gt; n;
  
      //READING INPUT FILE
      for( TIndex i = 0; i &lt; n; ++i )
      {
          Point p;
          input_file &gt;&gt; p;
          points.push_back(std::make_pair(p,i));
      }
      input_file.close();
  
      Triangulation T;
      T.insert(points.begin(), points.end());
  
      //OUTPUT FILE
      std::ofstream os(output);
      os &lt;&lt; "mtllib material.mtl" &lt;&lt; std::endl &lt;&lt; std::endl;
  
      for(Finite_vertices_iterator it = T.finite_vertices_begin();
      it != T.finite_vertices_end();
      ++it){
          os &lt;&lt; "v " &lt;&lt; it-&gt;point() &lt;&lt; " 0.0" &lt;&lt; std::endl;
      }
      os &lt;&lt; std::endl;
  
      int i=0;
  
      for(Finite_faces_iterator it = T.finite_faces_begin();
      it != T.finite_faces_end();
      ++it){
          os &lt;&lt; "usemtl " &lt;&lt; colors[i%6] &lt;&lt; std::endl;
          os &lt;&lt; "f " &lt;&lt; it-&gt;vertex(0)-&gt;info() &lt;&lt; " " &lt;&lt; it-&gt;vertex(1)-&gt;info() &lt;&lt; " " &lt;&lt; it-&gt;vertex(2)-&gt;info() &lt;&lt; std::endl;
          os &lt;&lt; std::endl;
          i++;
      }
  
      std::cout &lt;&lt; "File " &lt;&lt; output &lt;&lt; " generated" &lt;&lt; std::endl;
  
    return 0;
  }
  </code></pre>
  
  <p>The input.txt file is only this:</p>
  
  <pre><code>4
  0 0
  0 1
  1 1
  2 4
  </code></pre>
  
  <p>This code throw me an error in this line:</p>
  
  <pre><code>T.insert(points.begin(), points.end());
  </code></pre>
  
  <p>the compilation error is something like this:</p>
  
  <pre><code>error: no matching function for call to ‘CGAL::Point_2&lt;CGAL::Epick&gt;::Point_2(std::pair&lt;CGAL::Point_2&lt;CGAL::Epick&gt;, unsigned int&gt;&amp;)’
       { ::new(static_cast&lt;void*&gt;(__p)) _T1(std::forward&lt;_Args&gt;(__args)...); }
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /usr/local/include/CGAL/user_classes.h:30:0,
                   from /usr/local/include/CGAL/Kernel/global_functions_2.h:34,
                   from /usr/local/include/CGAL/Kernel/global_functions.h:32,
                   from /usr/local/include/CGAL/Cartesian/Cartesian_base.h:31,
                   from /usr/local/include/CGAL/Simple_cartesian.h:29,
                   from /usr/local/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:29,
  </code></pre>
  
  <p>There is something that i am doing wrong with this basic triangulations, because if i use Delaunay triangulations instead of basic triangulations the code compiles with no problem. But as i said before i don't want to use this kind triangulation. </p>