Boost logo

Geometry :

Subject: [geometry] self intersection doesn't find collinear intersection types
From: sergei benkovich (sergei1503_at_[hidden])
Date: 2016-05-11 03:27:08


Hey,
i have an issue where i find self intersections in a polygon.but it doesn't
seem to find the method_collinear type.

this is the piece of code:

  namespace bg = boost::geometry;
  using namespace std;
  typedef bg::model::d2::point_xy<double> point_2d;
  typedef bg::model::polygon<boost::geometry::model::d2::point_xy<double> >
Polygon;
  Polygon poly;
  poly.outer().push_back(point_2d(0, 10));
  poly.outer().push_back(point_2d(10, 0));

  typedef bg::point_type<Polygon>::type point_type;
  typedef bg::detail::overlay::traversal_turn_info
   <point_type,typename bg::segment_ratio_type<point_type,
bg::detail::no_rescale_policy>::type> turn_info;

  bg::detail::self_get_turn_points::no_interrupt_policy noInteruptPolicy;
  bg::detail::no_rescale_policy robust_policy;
  std::vector<turn_info> turns;
  bg::self_turns<bg::detail::overlay::assign_null_policy>(
    poly, robust_policy, turns, noInteruptPolicy);



Geometry list run by mateusz at loskot.net