Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Arrangement_2: assertion violation in Arr_traits_2/Bezier_bounding_rational_traits.h

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Arrangement_2: assertion violation in Arr_traits_2/Bezier_bounding_rational_traits.h


Chronological Thread 
  • From: David Keller <>
  • To:
  • Subject: Re: [cgal-discuss] Arrangement_2: assertion violation in Arr_traits_2/Bezier_bounding_rational_traits.h
  • Date: Fri, 12 Oct 2007 10:23:48 +0200

Hello,

Some problems seem to have survived the provided patch. I would like to append these to the above discussion on assertion violations even though the behavior is a slightly different one. The problem can be reproduced by calling the Bezier_curves example with the attached input file Bezier.dat. The problem manifests in the following output:

---
CGAL error: precondition violation!
Expr: t_res != EQUAL
File: /opt/CGAL-3.3.1/include/CGAL/Arr_traits_2/Bezier_x_monotone_2.h
Line: 676
Explanation:
terminate called after throwing an instance of 'CGAL::Precondition_exception'
what(): CGAL ERROR: precondition violation!
Expr: t_res != EQUAL
File: /opt/CGAL-3.3.1/include/CGAL/Arr_traits_2/Bezier_x_monotone_2.h
Line: 676
Aborted
---

Apart from this issue I would like to suggest an additional constructor in Bezier_point_2.h:
_Bezier_point_2 (const Rational& x, const Rational& y).

Would this conflict with the existing constructor _Bezier_point_2 (const Algebraic& x, const Algebraic& y) ? (Rational is convertible to Algebraic).
The use of the function
template <class Traits, class Dcel, class PointLocation>
typename Arrangement_2<Traits,Dcel>::Vertex_handle
insert_point (Arrangement_2<Traits,Dcel>& arr,
const typename Traits::Point_2& p,
const PointLocation& pl)
is now limited to the insertion of algebraic-points.
Algebraic-points can be constructed from rational-points and inserted by the above function of course. However, if one decides first to insert rational points which may later coincide with source- or target-points of Bezier-curves may encounter difficulties to do so with the current implementation. Or is there another preferred way to carry out such an operation?

Thanks and kind regards,
David Keller

Efraim Fogel wrote:
Hi David,

Ron Wein, has provided a fix. Attached is a patch you can use to apply the fix. Apply it from the include/CGAL directory ('patch < Bezier.diff').

It suppose to affect the following files:

Arr_traits_2/Bezier_cache.h
Arr_traits_2/Bezier_curve_2.h
Arr_traits_2/Bezier_x_monotone_2.h
Arr_traits_2/Bezier_point_2.h
Arr_traits_2/Bezier_bounding_rational_traits.h
Arr_Bezier_curve_traits_2.h

The problem in test case #1 can simply be avoided if you comment out the assertion on line 247 in Bezier_bounding_rational_traits.h

The problem in test case #2 happens when there exists a vertical tangency point that occurs exactly at the middle of the curve. As you can see from the size of the patch, it was a bit more difficult to fix. We hope that we eliminated the bugs or at least reduced their number...

Naturally, the fix will make it into the next release.


Attachment: Bezier.dat
Description: MOPAC data



  • Re: [cgal-discuss] Arrangement_2: assertion violation in Arr_traits_2/Bezier_bounding_rational_traits.h, David Keller, 10/12/2007

Archive powered by MHonArc 2.6.16.

Top of Page