Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] get segment from polygon edge

Subject: CGAL users discussion list

List archive

[cgal-discuss] get segment from polygon edge


Chronological Thread 
  • From: Mateus Bellomo <>
  • To:
  • Subject: [cgal-discuss] get segment from polygon edge
  • Date: Sun, 28 Aug 2016 21:02:30 -0300
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:dglK+xaYjhnGpHdR/Qcfefb/LSx+4OfEezUN459isYplN5qZpsS7bnLW6fgltlLVR4KTs6sC0LuP9fy7EjVRud7B6ClEK8McEUddyI0/pE8JPo2sMQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7MhdpdKyuQtaBx5f/6+fn8JLaZ0BEhSG2fKhpBBSwtwTY8McM0qV4LaNk7xLVr2ZTM85bwWdvIFXbyxP1+sqt55Ru9yBXvvUJ+MtJUKG8dKM9G+8LRA86Onw4sZW4/SLIShGCsyMR

Hello,

I have a Kernel::Segment_2 r which one of it's vertex is inside a GAL::Polygon_2<Kernel> p. I need to check if this segment r intersects one of polygon edges.

Right now I'm trying to do this:

  for(Polygon_edge_const_iterator e = p.edges_begin(); e != p.edges_end(); e++){
     auto result = intersection(r, e);
     if(result){
       Point_2* p = boost::get<Point_2>(&*result);
       return *p;
     }
  }

but I know it's not working because I need to get a segment from the edge. Anyone could help me to do this, please?

Thanks in advance!



Archive powered by MHonArc 2.6.18.

Top of Page