Opened 7 years ago

Last modified 7 years ago

#12139 new Bugs

Voronoi diagram contains NaN coordinates

Reported by: Piotr Wieczorek <pwiecz@…> Owned by: Lucanus Simonson
Milestone: To Be Determined Component: polygon
Version: Boost 1.60.0 Severity: Problem
Keywords: Cc:

Description

After computing Voronoi diagram for a large shape consisting of only segments (no points), resulting diagram contains some NaN coordinates. Segments are non-intersecting, as far as could've checked.

I'll try to simplify the shape and attach it here, so far I'm just showing the stacktrace of the division by zero causing a NaN: boost::polygon::detail::robust_fpt<double>::operator/(const boost::polygon::detail::robust_fpt<double> & that) Line 205 C++

boost::polygon::detail::voronoi_predicates<boost::polygon::detail::voronoi_ctype_traits<int> >::lazy_circle_formation_functor<boost::polygon::detail::site_event<int>,boost::polygon::detail::circle_event<double> >::pps(const boost::polygon::detail::site_event<int> & site1, const boost::polygon::detail::site_event<int> & site2, const boost::polygon::detail::site_event<int> & site3, int segment_index, boost::polygon::detail::circle_event<double> & c_event) Line 1095 C++ boost::polygon::detail::voronoi_predicates<boost::polygon::detail::voronoi_ctype_traits<int> >::circle_formation_predicate<boost::polygon::detail::site_event<int>,boost::polygon::detail::circle_event<double>,boost::polygon::detail::voronoi_predicates<boost::polygon::detail::voronoi_ctype_traits<int> >::circle_existence_predicate<boost::polygon::detail::site_event<int> >,boost::polygon::detail::voronoi_predicates<boost::polygon::detail::voronoi_ctype_traits<int> >::lazy_circle_formation_functor<boost::polygon::detail::site_event<int>,boost::polygon::detail::circle_event<double> > >::operator()(const boost::polygon::detail::site_event<int> & site1, const boost::polygon::detail::site_event<int> & site2, const boost::polygon::detail::site_event<int> & site3, boost::polygon::detail::circle_event<double> & circle) Line 1467 C++ boost::polygon::voronoi_builder<int,boost::polygon::detail::voronoi_ctype_traits<int>,boost::polygon::detail::voronoi_predicates<boost::polygon::detail::voronoi_ctype_traits<int> > >::activate_circle_event(const boost::polygon::detail::site_event<int> & site1, const boost::polygon::detail::site_event<int> & site2, const boost::polygon::detail::site_event<int> & site3, std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<boost::polygon::detail::beach_line_node_key<boost::polygon::detail::site_event<int> > const ,boost::polygon::detail::beach_line_node_data<void,boost::polygon::detail::circle_event<double> > > > > > bisector_node) Line 482 C++ boost::polygon::voronoi_builder<int,boost::polygon::detail::voronoi_ctype_traits<int>,boost::polygon::detail::voronoi_predicates<boost::polygon::detail::voronoi_ctype_traits<int> > >::process_circle_event<boost::polygon::voronoi_diagram<double,boost::polygon::voronoi_diagram_traits<double> > >(boost::polygon::voronoi_diagram<double,boost::polygon::voronoi_diagram_traits<double> > * output) Line 424 C++

boost::polygon::voronoi_builder<int,boost::polygon::detail::voronoi_ctype_traits<int>,boost::polygon::detail::voronoi_predicates<boost::polygon::detail::voronoi_ctype_traits<int> > >::construct<boost::polygon::voronoi_diagram<double,boost::polygon::voronoi_diagram_traits<double> > >(boost::polygon::voronoi_diagram<double,boost::polygon::voronoi_diagram_traits<double> > * output) Line 122 C++

Attachments (1)

builder.cpp (54.0 KB ) - added by Piotr Wieczorek <pwiecz@…> 7 years ago.
Crashing source

Download all attachments as: .zip

Change History (3)

by Piotr Wieczorek <pwiecz@…>, 7 years ago

Attachment: builder.cpp added

Crashing source

comment:1 by Piotr Wieczorek <pwiecz@…>, 7 years ago

As the following stacktrace may be pointing to a computation for the infinite edge, or something similar, I'm attaching a file where I'm checking that a finite edge contains a NaN coordinate.

comment:2 by awulkiew, 7 years ago

Component: geometrypolygon
Owner: changed from Barend Gehrels to Lucanus Simonson

It's Boost.Polygon, not Boost.Geometry.

Note: See TracTickets for help on using tickets.