id summary reporter owner description type status milestone component version severity resolution keywords cc 11242 Accuray issue with geometry::difference() in version Boost 1.57 (and 1.58) mikkel.stegmann@… Barend Gehrels "I'm having an accuracy issue with geometry::difference() in Boost v1.57 (and v1.58) that I didn't see with v1.55. The test program is listed below. I compiled using g++ 4.4.7 on Ubuntu 12.04. Result using Boost v1.55: {{{ 249.232 761.09 249.232 760.98 265.89 760.98 265.89 729.219 94.021 729.219 94.021 761.09 249.232 761.09 }}} Result using Boost v1.57 (and v1.58): {{{ 249.232003466816 761.09 249.232 760.98 265.89 760.979984987659 265.89 729.219 94.021 729.219 94.021 761.09 249.232003466816 761.09 }}} Apparently, it is related to the rescaling policy introduced in v1.56. I can mitigate the issue by defining the BOOST_GEOMETRY_NO_ROBUSTNESS. Best regards, Mikkel B. Stegmann ---- {{{ #include #include #include #include #include int main() { // 2D point with double precision typedef boost::geometry::model::d2::point_xy BoostPoint; // 2D polygon, ring type: clockwise, closed (""the first point must be spatially equal to the last point"") typedef boost::geometry::model::polygon BoostPolygon; BoostPolygon rectangleA; rectangleA.outer().push_back(BoostPoint( 94.021, 729.219)); // clock-wise points rectangleA.outer().push_back(BoostPoint( 94.021, 761.090)); rectangleA.outer().push_back(BoostPoint(265.890, 761.090)); rectangleA.outer().push_back(BoostPoint(265.890, 729.219)); rectangleA.outer().push_back(BoostPoint( 94.021, 729.219)); // close BoostPolygon rectangleB; rectangleB.outer().push_back(BoostPoint(249.232, 760.980)); // clock-wise points rectangleB.outer().push_back(BoostPoint(249.232, 780.980)); rectangleB.outer().push_back(BoostPoint(319.232, 780.980)); rectangleB.outer().push_back(BoostPoint(319.232, 760.980)); rectangleB.outer().push_back(BoostPoint(249.232, 760.980)); // close std::list differencePolygons; boost::geometry::difference(rectangleA, rectangleB, differencePolygons); assert(differencePolygons.size()==1); BOOST_FOREACH(const BoostPoint &point, differencePolygons.front().outer()) { printf(""%16.15g %16.15g\n"", point.x(), point.y()); } return 0; } }}}" Bugs new To Be Determined geometry Boost 1.57.0 Problem