[Boost-bugs] [Boost C++ Libraries] #8183: boost::geometry::intersection on two polygons returns incorrect empty intersection

Subject: [Boost-bugs] [Boost C++ Libraries] #8183: boost::geometry::intersection on two polygons returns incorrect empty intersection
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-26 09:24:56


#8183: boost::geometry::intersection on two polygons returns incorrect empty
intersection
---------------------------------+------------------------------------------
 Reporter: matthewd@… | Owner: barendgehrels
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: |
---------------------------------+------------------------------------------
 Hi

 The code snippet intersects 2 2D polygons resulting in an empty
 intersection. I'm including an image of the two polygons and they are
 overlapping. There may be a problem because the polygons share an
 overlapping edge?

 Thanks

 Matthew Danielsen

 {{{

 polygon_2d triangle2D;
 {
     const double triangle2Dcoor[] = {{0.891747, 2.28756}, {0.490911,
 -1.52549}, {-1.72945, -1.52549}, {0.891747, 2.28756}};
     assign(triangle2D, triangle2Dcoor);
 }

 polygon_2d box2D;
 {
     const double box2Dcoor[] = {{-1.6744, -1.52549}, {-1.70498, -1.52549},
 {-1.70052, -1.49155}, {-1.67049, -1.49579}, {-1.6744, -1.52549}};
     assign(box2D, box2Dcoor);
 }

 boost::geometry::model::multi_polygon<
 boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<T> >
> intersectionPolygons;
 boost::geometry::intersection(triangle2D, box2D, intersectionPolygons);
 assert(intersectionPolygons.size() != 0); // Assert fails

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8183>
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:12 UTC