computational geometry - CGAL: Intersection between a segment and a polygon? -


i have set of polygons , want test intersection between , segment. checked manual cannot find matching function. intersection between points, lines, segments, triangles, planes exist. , intersection between polygons there. question is:

  1. is there such function?
  2. if not, mean need break down polygons segments , intersection among these segments? (the reason reluctant is, thought cgal might in fact use way intersections between polygons. how come there no such function intersecting line , polygon?) or there other better way it?

the easiest method create polygon_set_2 object may contain several polygons. test intersection of external polygon set apply do_intersect method.

for example:

typedef cgal::polygon_set_2<kernel, std::vector<kernel::point_2>> polygon_set_2; polygon_set_2 ps; polygon_2     poly; polygon_2     line; // line polygon defined 2 points  ps.insert(poly); bool intersect = ps.do_intersect(line); 

more on polygon_set_2:

i hope it's clear, kiril


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -