I have a CGAL 2D Arrangement, and I would like to simplify each sequence of egdes separated by degree-2 vertices using CGAL::simplify. Is there a simple way to do that, or do I have to do something like the following:
- extract such sequences,
- simplify each sequence,
- modify the sequences in the arrangement?
Note that I would like to end up with a simplified 2D arrangement, not just a list of polylines, so using CGAL::split_graph_into_polylines does not seem to be the best option.
I had a look at CGAL manual and examples, but could not find an answer.
The function that you describe does not exist in the 2D Arrangements package. I'll consider adding it, but it only requires few lines of code. I changed the edge_manipulation example a bit to do what you describe. In particular, look for the loop over the vertices in the code below.