Re: [Boost-bugs] [Boost C++ Libraries] #6366: Bug in "boost::polygon::contains" for polygon_90 type

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6366: Bug in "boost::polygon::contains" for polygon_90 type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-25 17:19:36


#6366: Bug in "boost::polygon::contains" for polygon_90 type
----------------------------------+------------------------
  Reporter: sebastien.mirabel@… | Owner: asydorchuk
      Type: Bugs | Status: closed
 Milestone: Boost 1.53.0 | Component: polygon
   Version: Boost 1.51.0 | Severity: Problem
Resolution: fixed | Keywords:
----------------------------------+------------------------

Comment (by anonymous):

 The bug is still there in 1.55

  59 typedef polygon_90_data<int> Polygon;
  60 typedef polygon_traits_90<Polygon>::point_type Point;
  61 Point pts1[] = {
  62 construct<Point>(25200, 7100),
  63 construct<Point>(29000, 7100),
  64 construct<Point>(29000, 4950),
  65 construct<Point>(27100, 4950),
  66 construct<Point>(27100, 4250),
  67 construct<Point>(33050, 4250),
  68 construct<Point>(33050, 7050),
  69 construct<Point>(36300, 7050),
  70 construct<Point>(36300, 2300),
  71 construct<Point>(34700, 2300),
  72 construct<Point>(34700, 1600),
  73 construct<Point>(37000, 1600),
  74 construct<Point>(37000, 3500),
  75 construct<Point>(40550, 3500),
  76 construct<Point>(40550, 4850),
  77 construct<Point>(37000, 4850),
  78 construct<Point>(37000, 7100),
  79 construct<Point>(37900, 7100),
  80 construct<Point>(37900, 7800),
  81 construct<Point>(32350, 7800),
  82 construct<Point>(32350, 4950),
  83 construct<Point>(29700, 4950),
  84 construct<Point>(29700, 7100),
  85 construct<Point>(30300, 7100),
  86 construct<Point>(30300, 7800),
  87 construct<Point>(25200, 7800)
  88 };
  89
  90 Point pts2[] = {
  91 construct<Point>(25200, 7800),
  92 construct<Point>(30300, 7800),
  93 construct<Point>(30300, 7100),
  94 construct<Point>(29700, 7100),
  95 construct<Point>(29700, 4950),
  96 construct<Point>(32350, 4950),
  97 construct<Point>(32350, 7800),
  98 construct<Point>(37900, 7800),
  99 construct<Point>(37900, 7100),
 100 construct<Point>(37000, 7100),
 101 construct<Point>(37000, 4850),
 102 construct<Point>(40550, 4850),
 103 construct<Point>(40550, 3500),
 104 construct<Point>(37000, 3500),
 105 construct<Point>(37000, 1600),
 106 construct<Point>(34700, 1600),
 107 construct<Point>(34700, 2300),
 108 construct<Point>(36300, 2300),
 109 construct<Point>(36300, 7050),
 110 construct<Point>(33050, 7050),
 111 construct<Point>(33050, 4250),
 112 construct<Point>(27100, 4250),
 113 construct<Point>(27100, 4950),
 114 construct<Point>(29000, 4950),
 115 construct<Point>(29000, 7100),
 116 construct<Point>(25200, 7100)
 117 };
 118
 119 Polygon poly1;
 120 set_points(poly1, pts1, pts1+4);
 121 Polygon poly2;
 122 set_points(poly2, pts2, pts2+4);
 123
 124 Point point2 = construct<Point>(28000, 4950);
 125 Point point1 = construct<Point>(41900, 4950);
 126
 127 {
 128 bool result;
 129 result = contains(poly1, point1, true);
 130 std::cout << x(point1) << ", " << y(point1) << " in poly1 " <<
 std::boolalpha << result << std::endl;
 131
 132 result = contains(poly2, point1, true);
 133 std::cout << x(point1) << ", " << y(point1) << " in poly2 " <<
 std::boolalpha << result << std::endl;
 134
 135 result = contains(poly1, point2, true);
 136 std::cout << x(point2) << ", " << y(point2) << " in poly1 " <<
 std::boolalpha << result << std::endl;
 137
 138 result = contains(poly2, point2, true);
 139 std::cout << x(point2) << ", " << y(point2) << " in poly2 " <<
 std::boolalpha << result << std::endl;
 140 }


 Output:
 41900, 4950 in poly1 false
 41900, 4950 in poly2 false
 28000, 4950 in poly1 true
 28000, 4950 in poly2 false

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6366#comment:7>
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:15 UTC