CGAL 2D Delaunay Triangulation: How to get edges as vertex id pairs

前端 未结 1 1114
花落未央
花落未央 2020-12-10 06:47

I have a set of 2D points each with an associated id. (e.g. if the points are stored in an array, the id is the index into each point 0,....,n-1 ).

Now I create a De

相关标签:
1条回答
  • 2020-12-10 07:48

    First you need to use a vertex type with info as in these examples. Then an edge is a pair containing a handle to a face as well as the index of the vertex in the face that is opposite to the edge.

    if you have:

    Delaunay::Edge e=*it;
    

    indices you are looking for are:

    int i1= e.first->vertex( (e.second+1)%3 )->info();
    int i2= e.first->vertex( (e.second+2)%3 )->info();
    
    0 讨论(0)
提交回复
热议问题