So I have a disparate number of line segments which I want to combine to form a polygon. So imagine 4 points p0,p1,p2,p3
which form a open polygon p0-p1-p2-p3
. (This is illustrative : the polygon could be closed also)
But my algorithm generates the segments in random order say (p2,p3) (p0,p1) (p1,p2)
. Hence to combine them coherently I used the Arrangements_2 class in CGAL.
I have combined them. But now they form a single polygon with an unbounded face. I am not so sure how can I print out the vertex in an orderly fashion.
What I want is the algorithm to output (p0-p1-p2-p3) OR (p3-p2-p1-p0).
I looked at the documentation link here and they have a nice traversal order for bounded faces but not so much for unbounded faces.
My questions :
Can I achieve the same using traversals for unbounded face ?
If not Arrangements_2 what else can I use in CGAL to achieve the same thing ? (The next best thing I can think of is writing a DS myself)