[Boost-bugs] [Boost C++ Libraries] #11470: Invalid results using convex_hull with unsigned integer points coordinates

Subject: [Boost-bugs] [Boost C++ Libraries] #11470: Invalid results using convex_hull with unsigned integer points coordinates
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-07-10 11:15:12


#11470: Invalid results using convex_hull with unsigned integer points coordinates
-------------------------------------------------+-------------------------
 Reporter: Eric Noirfalise <eric.noirfalise@…> | Owner:
     Type: Bugs | barendgehrels
Milestone: To Be Determined | Status: new
  Version: Boost 1.58.0 | Component: geometry
 Keywords: | Severity: Problem
-------------------------------------------------+-------------------------
 Hi, I think convex_hull algorithm does not support unsigned integer points
 coordinates.

 The following code works well with signed integer but return a wrong
 result for unsigned version :


 {{{

 #include <boost/geometry.hpp>
 #include <boost/geometry/geometries/point_xy.hpp>
 #include <boost/geometry/geometries/polygon.hpp>
 #include <deque>


 int main()
 {
     typedef boost::geometry::model::d2::point_xy<unsigned int> PointInt;
     typedef boost::geometry::model::polygon<PointInt> polygon_type;

     polygon_type poly1, convPoly1;
     polygon_type poly2, convPoly2;
     boost::geometry::read_wkt("POLYGON((245 143, 243 113, 236 101, 228
 100, 222 106, 217 121, 217 144, 220 155, 227 165, 233 166, 237 163, 245
 143))", poly1);
     boost::geometry::convex_hull(poly1, convPoly1);

     return 0;
 }

 }}}

 Attached file is a representation of input polygon (orange) and output
 result (blue) curve.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11470>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC