psarahdactyl / wysiwyc

what you see is what you cut.
0 stars 0 forks source link

Flattener crashes on this turtle #1

Open alecjacobson opened 6 years ago

alecjacobson commented 6 years ago

Cool library!

I could get it to compile by adding const to already_set_in

But it crashes on this weird turtle.svg

turtle-exploded.svg.zip

psarahdactyl commented 6 years ago

Have recreated the bug; it's a CGAL problem. They are fixing it:

alecjacobson commented 6 years ago

Could you post the full stack trace of the crash in our program?

psarahdactyl commented 6 years ago

CGAL-vc140-mt-gd-4.12.dll!CGAL::precondition_fail(const char expr, const char file, int line, const char * msg) Line 192

CGAL::line_project_pointC2(const CGAL::Gmpq & la, const CGAL::Gmpq & lb, const CGAL::Gmpq & lc, const CGAL::Gmpq & px, const CGAL::Gmpq & py, CGAL::Gmpq & x, CGAL::Gmpq & y) Line 321

CGAL::CartesianKernelFunctors::Construct_projected_point_2<CGAL::Simple_cartesian >::operator()(const CGAL::Line_2<CGAL::Simple_cartesian > & l, const CGAL::Point_2<CGAL::Simple_cartesian > & p) Line 3170

CGAL::Lazy_rep_2<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<0> > >,CGAL::Point_2<CGAL::Simple_cartesian >,CGAL::CartesianKernelFunctors::Construct_projected_point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<0> > >,CGAL::CartesianKernelFunctors::Construct_projected_point_2<CGAL::Simple_cartesian >,CGAL::Cartesian_converter<CGAL::Simple_cartesian,CGAL::Simple_cartesian<CGAL::Interval_nt<0> >,CGAL::NT_converter<CGAL::Gmpq,CGAL::Interval_nt<0> > >,CGAL::Line_2,CGAL::Point_2 >::update_exact() Line 443

CGAL::Lazy_rep<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<0> > >,CGAL::Point_2<CGAL::Simple_cartesian >,CGAL::Cartesian_converter<CGAL::Simple_cartesian,CGAL::Simple_cartesian<CGAL::Interval_nt<0> >,CGAL::NT_converter<CGAL::Gmpq,CGAL::Interval_nt<0> > > >::exact() Line 271

CGAL::Lazy<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<0> > >,CGAL::Point_2<CGAL::Simple_cartesian >,CGAL::Gmpq,CGAL::Cartesian_converter<CGAL::Simple_cartesian,CGAL::Simple_cartesian<CGAL::Interval_nt<0> >,CGAL::NT_converter<CGAL::Gmpq,CGAL::Interval_nt<0> > > >::exact() Line 769

CGAL::exact<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<0> > >,CGAL::Point_2<CGAL::Simple_cartesian >,CGAL::Gmpq,CGAL::Cartesian_converter<CGAL::Simple_cartesian,CGAL::Simple_cartesian<CGAL::Interval_nt<0> >,CGAL::NT_converter<CGAL::Gmpq,CGAL::Interval_nt<0> > > >(const CGAL::Lazy<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<0> > >,CGAL::Point_2<CGAL::Simple_cartesian >,CGAL::Gmpq,CGAL::Cartesian_converter<CGAL::Simple_cartesian,CGAL::Simple_cartesian<CGAL::Interval_nt<0> >,CGAL::NT_converter<CGAL::Gmpq,CGAL::Interval_nt<0> > > > & l) Line 87
CGAL::Lazy_rep_3<CGAL::Interval_nt<0>,CGAL::Gmpq,CGAL::CartesianKernelFunctors::Compute_area_2<CGAL::Simple_cartesian<CGAL::Interval_nt<0> > >,CGAL::CartesianKernelFunctors::Compute_area_2<CGAL::Simple_cartesian >,CGAL::To_interval,CGAL::Point_2,CGAL::Point_2,CGAL::Point_2 >::update_exact() Line 443

CGAL::Lazy_rep<CGAL::Interval_nt<0>,CGAL::Gmpq,CGAL::To_interval >::exact() Line 271 CGAL::Lazy<CGAL::Interval_nt<0>,CGAL::Gmpq,CGAL::Lazy_exact_nt,CGAL::To_interval >::exact() Line 775

CGAL::Lazy_exact_Add<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>::update_exact() Line 306

CGAL::Lazy_rep<CGAL::Interval_nt<0>,CGAL::Gmpq,CGAL::To_interval >::exact() Line 271 CGAL::Lazy<CGAL::Interval_nt<0>,CGAL::Gmpq,CGAL::Lazy_exact_nt,CGAL::To_interval >::exact() Line 769

CGAL::Real_embeddable_traits<CGAL::Lazy_exact_nt >::Sgn::operator()(const CGAL::Lazy_exact_nt & a) Line 1053

CGAL::sign<CGAL::Lazy_exact_nt >(const CGAL::Lazy_exact_nt & x) Line 255

in_on_out(const CGAL::Segment_2 & seg, const std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & intersecting_segs, const CGAL::Point_2 & intersection, const std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & shape) Line 57

decide_to_keep(const std::vector<std::pair<CGAL::Segment_2,std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > >,std::allocator<std::pair<CGAL::Segment_2,std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > > > > & splits, const std::vector<std::pair<CGAL::Point_2,CGAL::Segment_2 >,std::allocator<std::pair<CGAL::Point_2,CGAL::Segment_2 > > > & intersections, const std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & shape, std::vector<int,std::allocator > & decisions, front_shape_type type) Line 35

fill_over_stroke(const std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & back, const std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & front, const std::vector<int,std::allocator > & background_indices, const std::vector<NSVGshape ,std::allocator<NSVGshape > > & shapes, const int shape_number, std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & visible_segments, std::vector<int,std::allocator > & visible_indices) Line 60

compare_2_shapes(const std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & background_shape, const std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & shape_to_add, const std::vector<int,std::allocator > & background_indices, const std::vector<NSVGshape ,std::allocator<NSVGshape > > & shapes, const int shape_number, std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & visible_segments, std::vector<int,std::allocator > & visible_indices) Line 25

flatten(const std::vector<NSVGshape ,std::allocator<NSVGshape > > & shapes, const std::vector<std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > >,std::allocator<std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > > > & segments, std::vector<CGAL::Segment_2,std::allocator<CGAL::Segment_2 > > & visible_segments, std::vector<int,std::allocator > & visible_indices) Line 68 C++ Symbols loaded. flattening.exe!main(int argc, char argv) Line 46

I call ConstructProjectedPoint__2 functor and I use the Epeck kernel

alecjacobson commented 6 years ago

Thanks. Can you point to where in our code we're calling this?

psarahdactyl commented 6 years ago

It was on line 57 of in_on_out.cpp when I compare the signs of two CGAL::Lazy_exact_nt's. But I don't need this code anymore so I commented it out. I still get the same problem on the same iteration. Now it's coming from line 64 of in_on_out.cpp, where I call is_horizontal() on an Epeck::Ray_2.