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: Mon, 17 Sep 2007 20:42:00 +0200

Thanks again for the fast reply and the precise answer.

Not to have the possibility to save the state in a persistent manner is a severe restriction for my intended application.

Aren't there considerations for/interests in Boost.Serialization (http://www.boost.org/libs/serialization/doc/index.html) as an alternative to the iostream-based approach of saving/loading objects in CGAL? Serialization of the arrangement DCEL through boost is possible out-of-the-box in a non-intrusive way. The Arrangement_2-template is serializable with slight changes or maybe some tricks involving the Arrangement_accessor (non-intrusive). The main issue remains the serialization of Core-numbers (or other algebraics), especially CORE::Expr, which in the most complex case involves the serialization of polynomials of rational-coefficients and a bunch of plain data. Overall there are lots of collateral pitfalls -- just look at the pointer arithmetics in Bezier_cache -- rendering the task not trivial either, but I see some light at the end of the tunnel ;-)

Efraim Fogel wrote:
Again, the answer below is provided by Ron:

It is impossible to use the I/O operations of arrangements of Bezier
curves. While the Bezier curves supports operators >> and << (basically
reading and writing its sequence of *rational* control points), it is
difficult to output a point in a way that we can read and use afterwards
(well, we can approximate it, but we loose its algebraic representation,
if one was computed).

You already suspected that these operations are "likely not trivial to
add" for a point. Indeed they are.

David Keller wrote:
Hi,

I'm appending this here, even though it is not directly related to the
above discussed issues:
What is required for the stream-IO of Bezier-curve-arrangements?

____

typedef CGAL::CORE_algebraic_number_traits nt_traits;
typedef nt_traits::Rational rational;
typedef nt_traits::Algebraic algebraic;
typedef CGAL::Cartesian<rational> rational_kernel;
typedef CGAL::Cartesian<algebraic> algebraic_kernel;
typedef CGAL::Arr_Bezier_curve_traits_2<rational_kernel,
algebraic_kernel, nt_traits> traits;
typedef CGAL::Arrangement_with_history_2<traits> arrangement;

...
arrangement a;
...

std::ofstream outfile( "bezier.dat" );
outfile << a ;
____

For a first try I get stuck with some compile-time errors:

/opt/CGAL-3.3.1/include/CGAL/IO/Arr_text_formatter.h: In member
function ‘void
CGAL::Arr_text_formatter<Arrangement_>::read_point(typename
Arrangement_::Traits_2::Point_2&) [with Arrangement_ =
CGAL::Arrangement_with_history_2<CGAL::Arr_Bezier_curve_traits_2<CGAL::Cartesian<CORE::BigRat>,
CGAL::Cartesian<CORE::Expr>, CGAL::CORE_algebraic_number_traits,
CGAL::Bezier_bounding_rational_traits<CGAL::Cartesian<CORE::BigRat> >
,
CGAL::Arr_default_dcel<CGAL::Arr_Bezier_curve_traits_2<CGAL::Cartesian<CORE::BigRat>,
CGAL::Cartesian<CORE::Expr>, CGAL::CORE_algebraic_number_traits,
CGAL::Bezier_bounding_rational_traits<CGAL::Cartesian<CORE::BigRat> >
]’:
libs/bspline/test/bezier_curve.cpp:391: instantiated from here
/opt/CGAL-3.3.1/include/CGAL/IO/Arr_text_formatter.h:371: error: no
match for ‘operator>>’ in ‘CGAL::Arr_text_formatter<Arrangement_>::in
[with Arrangement_ =
CGAL::Arrangement_with_history_2<CGAL::Arr_Bezier_curve_traits_2<CGAL::Cartesian<CORE::BigRat>,
CGAL::Cartesian<CORE::Expr>, CGAL::CORE_algebraic_number_traits,
CGAL::Bezier_bounding_rational_traits<CGAL::Cartesian<CORE::BigRat> >
,
CGAL::Arr_default_dcel<CGAL::Arr_Bezier_curve_traits_2<CGAL::Cartesian<CORE::BigRat>,
CGAL::Cartesian<CORE::Expr>, CGAL::CORE_algebraic_number_traits,
CGAL::Bezier_bounding_rational_traits<CGAL::Cartesian<CORE::BigRat> >
]() >> p’
When trying to hunt these down it seems _Bezier_point_2 is missing
some operator>> and operator<<. I cannot find these in the
distribution and they are likely not trivial to add from my point of
view.

Kind regards,
David Keller



Archive powered by MHonArc 2.6.16.

Top of Page