Opened 11 years ago

Closed 11 years ago

#6078 closed Bugs (duplicate)

bug in polygon::resize

Reported by: Jay Huang <yhuangza@…> Owned by: Lucanus Simonson
Milestone: To Be Determined Component: polygon
Version: Boost 1.47.0 Severity: Problem
Keywords: polygon resize Cc:

Description

Hi,

I found two bug in polygonset::resize() as follows,

bug1

std::vector<Point> pts; Polygon poly; PolygonSet polySet, polySetResult;

pts.clear(); pts.push_back(Point( 6300, 0)); pts.push_back(Point( 0, 0)); pts.push_back(Point( 0, 4750)); pts.push_back(Point( 1250, 6000)); pts.push_back(Point( 1250, 7500)); pts.push_back(Point( 2850, 7500)); pts.push_back(Point( 2850, 5950)); pts.push_back(Point( 5950, 5950)); pts.push_back(Point( 5950, 5750)); pts.push_back(Point( 6300, 5400));

boost::polygon::set_points(poly, pts.begin(), pts.end());

polySet += poly; polySetResult += polySet-1000;

bug2

std::vector<Point> pts2; Polygon poly2; PolygonSet polySet2, polySetResult2;

pts2.clear(); pts2.push_back(Point(2100, 2575)); pts2.push_back(Point(1700, 2575)); pts2.push_back(Point(1700, 2365)); pts2.push_back(Point(1800, 2265)); pts2.push_back(Point(1835, 2265)); pts2.push_back(Point(1835, 1945)); pts2.push_back(Point(1645, 1945)); pts2.push_back(Point(1645, 2305)); pts2.push_back(Point(1440, 2305)); pts2.push_back(Point(1440, 2790)); pts2.push_back(Point(1145, 2790)); pts2.push_back(Point(1145, 1805)); pts2.push_back(Point(2100, 1805));

boost::polygon::set_points(poly2, pts2.begin(), pts2.end());

polySet2 += poly2; polySetResult2 += polySet2+100;

For bug one,

current result : { 1000 4336, 1000 1000, 5300 1000, 5300 4986, 4950 5336, 4950 4950, 1850 4950, 1850 5186} correct result : { 1000 4336, 1000 1000, 5300 1000, 5300 4950, 1850 4950, 1850 5186}

For bug two, the result is a polygon with hole. However, I think there shall be no hole in the result.

Please check and thanks for your help.

Regards, Jay Huang

Change History (1)

comment:1 by Jay Huang <yhuangza@…>, 11 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.