Subject: [Boost-bugs] [Boost C++ Libraries] #10640: boost geometry buffer algorithm and counterclockwise polygons
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-09 16:41:24
#10640: boost geometry buffer algorithm and counterclockwise polygons
------------------------------+---------------------------
Reporter: dopamine@⦠| Owner: barendgehrels
Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
Version: Boost 1.56.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------
the buffer algorithm does not seem to work (the result multipolygon is
always empty) if the input model::polygons are defines as
counterclockwise.
test code (adapted from the buffer documentation):
{{{
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/geometries.hpp>
int main()
{
typedef double coordinate_type;
typedef boost::geometry::model::d2::point_xy<coordinate_type> point;
//counterclockwise
typedef boost::geometry::model::polygon<point,false> polygon;
const double buffer_distance = 1.0;
const int points_per_circle = 36;
boost::geometry::strategy::buffer::distance_symmetric<coordinate_type>
distance_strategy(buffer_distance);
boost::geometry::strategy::buffer::join_round
join_strategy(points_per_circle);
boost::geometry::strategy::buffer::end_round
end_strategy(points_per_circle);
boost::geometry::strategy::buffer::point_circle
circle_strategy(points_per_circle);
boost::geometry::strategy::buffer::side_straight side_strategy;
boost::geometry::model::multi_polygon<polygon> result;
boost::geometry::model::multi_polygon<polygon> mpol;
//points reversed to get a positive area()
boost::geometry::read_wkt("MULTIPOLYGON(((0 1,5 3,2 5,0 1)),((1 1,5
0,5 2,1 1)))", mpol);
boost::geometry::buffer(mpol.front(), result,
distance_strategy, side_strategy,
join_strategy, end_strategy, circle_strategy);
//always zero
std::cerr<<"result size = "<<result.size()<<std::endl;
return 0;
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10640> 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:17 UTC