I'd like to be able to extract vertices of each edge on the triangulation boundary. The thing is that I first define constrained triangulation by defining constraints and holes in domain if necessary. Then I need to refine mesh via mesh refinement algorithm. It all works nice and dandy, except for one glitch. I have to tell which edge lies on which boundary. Let me give you an example: Given 4 polylines that define the domain, and are constraints in triangulation, (say top, bottom, left and right polyline), I have to tell wich edge lies on which polyline. I had defined each polyline as std::vector, which can be easily probed for point on segment. Like this: CDT::Point pt1; CDT::Point pt2;
for(const auto& seg : segments)
{
if(seg.has_on(pt1))
{ num++; }
if(seg.has_on(pt2))
{ num++; }
if(num==2){/*success? -> return true*/}
}
I'm aware of CGAL::bounded_side_2 function, which sadly operates on polygons. How can I solve this problem?
for(CDT::Finite_edges_iterator it = cdt.finite_edges_begin();
it != cdt.finite_edges_end(); ++it)
{
CDT::Edge e=*it;
// how can I tell if an edge is on boundary?
}