1
我试图用Boost.Geometry图书馆找方和线的交点的第二点,Boost.Geometry没有找到多边形线intersecion
model::ring<model::d2::point_xy<double>> ring { {0, 0}, {2, 0}, {2, 2}, {0, 2} };
model::polygon<model::d2::point_xy<double>> pol;
pol.inners().push_back (ring);
model::linestring<model::d2::point_xy<double>> line { {1, 3}, {-1, -1} };
model::multi_point<model::d2::point_xy<double>> out;
intersection (pol, line, out); //out returns only {0.5, 2}, but not {0, 1}
但它返回只有一个点, althougt居然有交集
我怎样才能找到交集的所有点的两个点?
谢谢,这是工程。但环已经有参数闭合,这是默认情况下,我认为这只是针对这些情况。是否被交集算法忽略? – user3514538