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:24:34
#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 boost_1_55_0!!
typedef polygon_90_data<int> Polygon;
typedef polygon_traits_90<Polygon>::point_type Point;
Point pts1[] = {
construct<Point>(25200, 7100),
construct<Point>(29000, 7100),
construct<Point>(29000, 4950),
construct<Point>(27100, 4950),
construct<Point>(27100, 4250),
construct<Point>(33050, 4250),
construct<Point>(33050, 7050),
construct<Point>(36300, 7050),
construct<Point>(36300, 2300),
construct<Point>(34700, 2300),
construct<Point>(34700, 1600),
construct<Point>(37000, 1600),
construct<Point>(37000, 3500),
construct<Point>(40550, 3500),
construct<Point>(40550, 4850),
construct<Point>(37000, 4850),
construct<Point>(37000, 7100),
construct<Point>(37900, 7100),
construct<Point>(37900, 7800),
construct<Point>(32350, 7800),
construct<Point>(32350, 4950),
construct<Point>(29700, 4950),
construct<Point>(29700, 7100),
construct<Point>(30300, 7100),
construct<Point>(30300, 7800),
construct<Point>(25200, 7800)
};
Point pts2[] = {
construct<Point>(25200, 7800),
construct<Point>(30300, 7800),
construct<Point>(30300, 7100),
construct<Point>(29700, 7100),
construct<Point>(29700, 4950),
construct<Point>(32350, 4950),
construct<Point>(32350, 7800),
construct<Point>(37900, 7800),
construct<Point>(37900, 7100),
construct<Point>(37000, 7100),
construct<Point>(37000, 4850),
construct<Point>(40550, 4850),
construct<Point>(40550, 3500),
construct<Point>(37000, 3500),
construct<Point>(37000, 1600),
construct<Point>(34700, 1600),
construct<Point>(34700, 2300),
construct<Point>(36300, 2300),
construct<Point>(36300, 7050),
construct<Point>(33050, 7050),
construct<Point>(33050, 4250),
construct<Point>(27100, 4250),
construct<Point>(27100, 4950),
construct<Point>(29000, 4950),
construct<Point>(29000, 7100),
construct<Point>(25200, 7100)
};
Polygon poly1;
set_points(poly1, pts1, pts1+4);
Polygon poly2;
set_points(poly2, pts2, pts2+4);
Point point2 = construct<Point>(28000, 4950);
Point point1 = construct<Point>(41900, 4950);
{
bool result;
result = contains(poly1, point1, true);
std::cout << x(point1) << ", " << y(point1) << " in poly1 " <<
std::boolalpha << result << std::endl;
result = contains(poly2, point1, true);
std::cout << x(point1) << ", " << y(point1) << " in poly2 " <<
std::boolalpha << result << std::endl;
result = contains(poly1, point2, true);
std::cout << x(point2) << ", " << y(point2) << " in poly1 " <<
std::boolalpha << result << std::endl;
result = contains(poly2, point2, true);
std::cout << x(point2) << ", " << y(point2) << " in poly2 " <<
std::boolalpha << result << std::endl;
}
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:8> 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