Here is the code:
struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Constrained_triangulation_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS;
typedef CGAL::Exact_predicates_tag Itag;
typedef CGAL::Constrained_triangulation_2<K, TDS, Itag> CT;
typedef CT::Point Point;
for (CT::Finite_edges_iterator eit = ct.finite_edges_begin();
eit != ct.finite_edges_end(); ++eit){
}
From manual :
"The edges are not represented explicitly, they are implicitly represented through the adjacency relations of two faces. Each edge has two implicit representations: the edge of the face f, which is opposite to the index i with the vertex, can be represented as well as the edge of the neighbor (i) from f."
This is good for me ... but how do I get the final vertex edges using CT::Finite_edges_iteratorin the above code?
Update:
I managed to find this solution:
Segment s = ct.segment(eit);
const Point& p1 = s.point(0);
const Point& p2 = s.point(1);
I'm still looking for a better way to do this.
source
share