Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] polygon intersection problem

Subject: CGAL users discussion list

List archive

[cgal-discuss] polygon intersection problem


Chronological Thread 
  • From: Jasmin Formont <>
  • To:
  • Subject: [cgal-discuss] polygon intersection problem
  • Date: Tue, 17 Apr 2012 17:17:54 +0200

hi folks
I'm new to CGAL and I'm having with polygon intersection. I read 2 polygons from a file and create them this way :
//pseudocode
Polygon_2 pgn   //I typedefed this as CGAL::Polygon_2<Kernel>
for each(point pt in file)
     pgn.push_back(Point_2(pt.x, pt.y))    //Point_2 is Kernel::Point_2

When I print these polygons in a file, they are exactly as my input polygons, so I assume my Polygon_2 are well created and correct.

My problem comes when I try to execute CGAL::do_intersect(pgn1, pgn2)
I get this error :
CGAL error : precondition violation!
_expression_ : ! is_degen
File            : C:\Program Files\CGAL-4.0\include\CGAL\Arr_segment_traits_2.h
Line           : 127
Explanation: cannot construct a degenerate segment

I attached the polygons I use (dxf file), they don't have any degenerate segment.
I have this problem with both Exact_predicates_exact_constructions_kernel and Exact_predicates_inexact_constructions_kernel.

I'd appreciate any help
thanks

Jasmin





Attachment: multipgn.dxf
Description: application/dxf




Archive powered by MHonArc 2.6.16.

Top of Page