Reputation: 335
I need to find the medial axis of a concave polygon with holes. I'm using CGAL. My current approach is:
I can build the SDG, and testing edges should be straight forward but I'm struggling to extract the edges of the SDG, or the corresponding Voronoi graph rather. There should be a few types of edges I'd expect: points, lines and parabolas.
How do I do this? Am I even on the right track?
Also I know I can iterate through the edges of the graph using one of the supplied methods and I understand this returns the face and opposite vertex to the edge. But how do I use this to get, say, the endpoints of a bisecting line?
Upvotes: 0
Views: 386
Reputation: 6253
You can use the functions draw_dual()
or draw_skeleton(). The parabola arc will be approximated by segments. You can look at the implementation of the method if you need more control on the output.
You can use such a class for collecting objects:
struct Collector
{
std::vector<Ray_2> rays;
std::vector<Line_2> lines;
std::vector<Segment_2> segs;
void operator<<(const Ray_2& p){rays.push_back(p);}
void operator<<(const Line_2& p){lines.push_back(p);}
void operator<<(const Segment_2& p){segs.push_back(p);}
};
Upvotes: 1