cannot read Polygon_2 from std::istream (with CGAL::Gps_circle_segment_traits_2)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

cannot read Polygon_2 from std::istream (with CGAL::Gps_circle_segment_traits_2)

Forest Darling

I have a "CGAL::Gps_circle_segment_traits_2" Polygon_2  that I generate and manipulate in CGAL. When trying to take the orientation of the polygon (one of the first operations I do), CGAL fails a precondition assertion. This only happens if I use the "CGAL::Simple_cartesian<double>" kernel, it works with the "CGAL::Exact_predicates_exact_constructions_kernel" kernel.

It's a very basic shape, so I was trying to investigate the issue by creating a minimal C++ example to demonstrate the problem. However, I ran into another problem: while I can export the Polygon_2 as binary, I cannot import it!

It seems to be that while General_polygon_2 has the ability to read from an istream:

The "Traits::X_monotone_curve_2" which resolves to "_X_monotone_circle_segment_2" in the case of "CGAL::Gps_circle_segment_traits_2" only supports exporting to an ostream, not importing from an istream:

Is this an oversight? Is it by design? Or am I missing something here? I attached a main.cpp file that will give the compilation error when trying to deserialize the Polygon_2.

I'd appreciate any help!



You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to

main.cpp (2K) Download Attachment
bad.bin (212 bytes) Download Attachment