Subject: CGAL users discussion list
List archive
- From: Genís <>
- To:
- Subject: [cgal-discuss] CGAL::symmetric_difference error
- Date: Thu, 3 Sep 2009 15:54:20 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=trcSrjx9kpKlT2sCwxuqZJ6zee8anUBvSuTP+9JrDCY/+UbPeBjoaNgmYJEa7EPPmU fPjpFOWJYZC69UlwkqA9wdHkaMzg4OZUXnEbGxRKsEDbGDDHCv2YHQNaJliW4cC0vET6 TFNT+byVr3yKpX2YEOGyKXkpT2aEHc3Yen9AU=
Hi,
I am devolopping an app. that calls the CGAL method symmetric_difference(..). As arguments, I pass two polygons and before that call I check that they are simple and same direction oriented (counterclockwise oriented, in fact). I thought I checked all compulsory preconditions, but often I get that exception when calling symmetric_difference:
CGAL error:
precondition violation!
Expr: comp_f(object, nodeP->object) != LARGER
File: /usr/include/CGAL/Multiset.h
Line: 2140
What's more, I sometimes also get that one:
CGAL error:
assertion violation!
Expr: *slIter == curve
File: /usr/include/CGAL/Basic_sweep_line_2.h
Line: 675
That last I get it hardly ever, so I doesn't bother me in the way that first one does.
That is the piece of code from which I get these errors:
typedef CGAL::Cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef CGAL::Polygon_2<Kernel> Polygon_2;
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes_2;
typedef std::list<Polygon_with_holes_2> Pwh_list_2;
typedef std::list<Polygon_2> Holes_container;
Polygon_2 Q,P;
/* here I construct Q and P after checking there are at least three vertexs to construct both of them */
if( ! (Q.is_simple() && P.is_simple()) ){
throw string("Polygon::symmetric_difference -> entered polygon not simple");
}
if(!Q.is_counterclockwise_oriented ())
Q.reverse_orientation();
if(!P.is_counterclockwise_oriented ())
P.reverse_orientation();
Pwh_list_2 symmR;
CGAL::symmetric_difference(P, Q, std::back_inserter(symmR));
Is there any precondition I violate or is just an internal error from the library?
By the way, this is my first post in that mail list. Don't be afraid to warn me if there is any convention I don't follow (and sorry for my poor english).
Thank you in advance
-------------------------------------------------
Genís Aguilar López
- [cgal-discuss] CGAL::symmetric_difference error, Genís, 09/03/2009
- Re: [cgal-discuss] CGAL::symmetric_difference error, Bernd Gaertner, 09/03/2009
- Re: [cgal-discuss] CGAL::symmetric_difference error, Laurent Rineau (GeometryFactory), 09/03/2009
- Re: [cgal-discuss] CGAL::symmetric_difference error, Ben Supnik, 09/03/2009
- Re: [cgal-discuss] CGAL::symmetric_difference error, Genís, 09/03/2009
- Re: [cgal-discuss] CGAL::symmetric_difference error, Ben Supnik, 09/03/2009
- Re: [cgal-discuss] CGAL::symmetric_difference error, Laurent Rineau (GeometryFactory), 09/03/2009
- Re: [cgal-discuss] CGAL::symmetric_difference error, Bernd Gaertner, 09/03/2009
Archive powered by MHonArc 2.6.16.