Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] CGAL polygon intersection predicate - precondition exception!

Subject: CGAL users discussion list

List archive

[cgal-discuss] CGAL polygon intersection predicate - precondition exception!


Chronological Thread 
  • From: Gillian Ng <>
  • To:
  • Subject: [cgal-discuss] CGAL polygon intersection predicate - precondition exception!
  • Date: Tue, 19 Jul 2011 02:46:56 -0700 (PDT)

I'm just trying to find out if two polygons intersect. However it gives this
error, which seems odd... I'm using CGAL 3.6.1 with Visual Studio .NET 2005.

----------
CGAL error: precondition violation!
Expression : ! _predP->is_valid() || comp_f(object, _predP->object) !=
SMALLER
File : d:\libs\cgal_vc8\include\cgal\multiset.h
Line : 2142
Explanation:
Refer to the bug-reporting instructions at
http://www.cgal.org/bug_report.html
----------

This is the code I wrote:

----------
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polygon_2 <K> Polygon_2;

bool DoPolygonsIntersect( Polygon_2 &p1, Polygon_2 &p2 )
{
if ( CGAL::do_overlap( p1.bbox(), p2.bbox() ) )
{
if ( CGAL::do_intersect( p1, p2 ) )
{
return true;
}
}

return false;
}
----------

Please help! Thanks a lot guys.

--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/CGAL-polygon-intersection-predicate-precondition-exception-tp3677725p3677725.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page