Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] precorditions failure on joining 3 polygon_2s with 4 vertices each
Chronological Thread
- From: Efi Fogel <>
- To:
- Subject: Re: [cgal-discuss] precorditions failure on joining 3 polygon_2s with 4 vertices each
- Date: Sun, 23 Sep 2012 15:49:06 +0200
You are doing something wrong.
First of all, you are joining polygons, which means that new intersection points might be constructed. Therefore, you must use Exact_predicates_exact_constructions_kernel kernel (instead of the Exact_predicates_inexact_constructions_kernel kernel currently used in your example).
Even if you had known that no new intersection points are expected to be constructed you would have still needed to use the Exact_predicates_exact_constructions_kernel kernel, as explained next. The code that you write implicitly uses the Arr_segment_traits_2. This traits maintains a segment by its 2 endpoints and the underlying line. The constructor of the segments accepts the 2 endpoints as input arguments and CONSTRUCTS the underlying line. Therefore, you must use the Exact_predicates_exact_constructions_kernel kernel.
I've tried it and it works.
--
First of all, you are joining polygons, which means that new intersection points might be constructed. Therefore, you must use Exact_predicates_exact_constructions_kernel kernel (instead of the Exact_predicates_inexact_constructions_kernel kernel currently used in your example).
Even if you had known that no new intersection points are expected to be constructed you would have still needed to use the Exact_predicates_exact_constructions_kernel kernel, as explained next. The code that you write implicitly uses the Arr_segment_traits_2. This traits maintains a segment by its 2 endpoints and the underlying line. The constructor of the segments accepts the 2 endpoints as input arguments and CONSTRUCTS the underlying line. Therefore, you must use the Exact_predicates_exact_constructions_kernel kernel.
I've tried it and it works.
On Thu, Sep 20, 2012 at 12:40 PM, bobbens <> wrote:
Hello,
I'm not sure if I'm doing something wrong, but I am getting precondition
failures on attempting to join 4 different simple polygons with 4 vertices
each. I'm attaching the code to reproduce (must compile in debug mode) and a
visual representation of the four polygons. They are being joined as part of
a polygon set.
With CGAL 3.9 (Ubuntu 12.04) I get:
terminate called after throwing an instance of
'CGAL::Precondition_exception'
what(): CGAL ERROR: precondition violation!
Expr: cv.is_in_x_range (p)
File: /usr/include/CGAL/Arr_segment_traits_2.h
Line: 487
With CGAL 4.0 (Arch linux) I get:
terminate called after throwing an instance of
'CGAL::Precondition_exception'
what(): CGAL ERROR: precondition violation!
Expr: comp_f(object, parentP->object) != SMALLER
File: /usr/include/CGAL/Multiset.h
Line: 2128
So my main question is, am I doing something wrong? I was under the
impression that the join should work. This is part of a larger framework
that works on many other cases but seems to fail in this particular one. The
code for the minimal reproduction case is very simple as can be seen.
Thanks,
Edgar
poly_precond.cpp
<http://cgal-discuss.949826.n4.nabble.com/file/n4655881/poly_precond.cpp>
polygons.png
<http://cgal-discuss.949826.n4.nabble.com/file/n4655881/polygons.png>
--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/precorditions-failure-on-joining-3-polygon-2s-with-4-vertices-each-tp4655881.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
--
____ _ ____ _
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
- [cgal-discuss] precorditions failure on joining 3 polygon_2s with 4 vertices each, bobbens, 09/20/2012
- Re: [cgal-discuss] precorditions failure on joining 3 polygon_2s with 4 vertices each, Efi Fogel, 09/23/2012
- Re: [cgal-discuss] precorditions failure on joining 3 polygon_2s with 4 vertices each, Edgar Simo-Serra, 09/24/2012
- Re: [cgal-discuss] precorditions failure on joining 3 polygon_2s with 4 vertices each, Efi Fogel, 09/23/2012
Archive powered by MHonArc 2.6.18.