Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Sweep_line_2 bug crashed doing polygons intersection (or other operations)

Subject: CGAL users discussion list

List archive

[cgal-discuss] Sweep_line_2 bug crashed doing polygons intersection (or other operations)


Chronological Thread 
  • From: Konstantin Sinitsyn <>
  • To:
  • Subject: [cgal-discuss] Sweep_line_2 bug crashed doing polygons intersection (or other operations)
  • Date: Fri, 17 Jul 2009 15:49:23 +0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; b=FRAYATxhiQ0FXgfVMOZFgAmNCzpmEunpwa9umhTk5fJM02/HtkQ1QlKlg6yZZ/EkUt qY0GOxdttufa9nHdCsLK79rB1+uJkh/MjGpp4zSOM4IAtsqYdZxp74fL3yPd4PynbCwj Tjq5Alu8PjNDUzefTAE8ui1tURMgHZYOST0uA=

Hello!

I am new to CGAL and currently I have some problems with polygon boolean
operations in my application.

Look at attched source file, some precondition assertion occurs in sweep
line algorithm when calling do_intersect function on two simple
polygons. I thing this happens when we have intersections with vertical
edges of polygons (with horizontal looks like all ok).

PS: I'm using lasted version of CGAL (3.4) and boost (1.39), MSVC 9.0 SP1.

Thanks.
Konstantin!


#include <stdio.h>

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Boolean_set_operations_2.h>


typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point2;
typedef CGAL::Polygon_2<Kernel> Polygon2;


int main( int argc, char * argv[] )
{
const Point2 pts1[] =
{
Point2(-499.99999230168760, -999.99998460196844),
Point2( 499.99999230168760, -999.99998460196844),
Point2( 499.99999230168760, 999.99998460196844),
Point2(-499.99999230168760, 999.99998460196844),
};

const Point2 pts2[] =
{
Point2(-501.20249900259773, 0.5033923373302715),
Point2(-499.62250333474009, 3.3133937198248864),
Point2(-499.62250532386037, 5.6933937150556835),
Point2(-501.20250568035868, 8.4933923468642227),
};

const Polygon2
pgn1(pts1, pts1 + sizeof(pts1) / sizeof(pts1[0])),
pgn2(pts2, pts2 + sizeof(pts2) / sizeof(pts2[0]));

CGAL::do_intersect(pgn1, pgn2);

return 0;
}




Archive powered by MHonArc 2.6.16.

Top of Page