On 28 Jul 2016, at 10:31, Pol Monsó Purtí <

[hidden email]> wrote:

CGAL::intersect and do_intersect take segments, rays, squares... but not polygon_2.

Indeed, because intersect is in the CGAL Kernel(s), which only handle(s) constant-size objects, by definition.

And the reverse for Polygon_2 intersection functions, who only takes polygons.

How do you usually solve this, iterating over the segments of the polygon + checking if the ends are inside?

Sounds reasonable.

Alternatively, if you want to use the intersection function of polygons, you can also create another polygon from the two vertices of the segment, then intersect the two polygons. Not sure about efficiency (I don’t precisely know how the intersection of 2 polygons is implemented).