Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Sub-segments of intersecting segments

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Sub-segments of intersecting segments


Chronological Thread 
  • From: Pierre Alliez <>
  • To:
  • Subject: Re: [cgal-discuss] Sub-segments of intersecting segments
  • Date: Fri, 03 Oct 2008 08:34:45 +0200
  • Organization: INRIA

hi Amit,

try inserting all your segments as constrained edges of a 2D constrained Delaunay triangulation which accepts intersections.

you then have to collect all constrained edges when you are done.


Amit Pendharkar a écrit :
Hi All,

Of given n randomly placed segments in a plane how to find out all the sub-segments that are formed due to intersections? Two segments, if intersect, will give rise to four sub-segments.

E.g. a vector seg will contain the original segments and another vector sub_seg should contain all the sub-segments after processing.

A lame solution would be to check if every two segments intersect and if they do, replace them with four sub-segments and restart the checking.

Is there any better way? Though http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Sweep_line_2/Chapter_main.html looks useful, this is not I want.

I want to find out the sub-segments and not merely the intersection points.

Your inputs are appreciated.

Thanks & Regards,
Amit Pendharkar




Archive powered by MHonArc 2.6.16.

Top of Page