This code snippet works fine in 2D version, but doesn't compile in 3D version:
namespace bg = boost::geometry;
typedef bg::model::point<double, 3, bg::cs::cartesian> Point3D;
typedef bg::model::polygon<Point3D> Poly3D;
Poly3D p0, p1;
vector<Poly3D> result;
bg::read_wkt("POLYGON((0 0 0, 0 1 1, 1 0 0, 0 0 0))", p0);
bg::read_wkt("POLYGON((0 0 0.5, 0 11 0.5, 11 0 0.5, 0 0 0.5))", p1);
bg::intersection(p0, p1, result);
with this template error:
1>C:\boost_1_54_0\boost/geometry/core/coordinate_dimension.hpp(89): error C2338: ( boost::mpl::equal_to < geometry::dimension<Geometry>, boost::mpl::int_<Dimensions> >::type::value )
...
Can anyone tell me what is wrong with intersection
call? My application is to find intersection of planar polygons. I can see that in general case Poly3D
doesn't have to be planar, so it can be the source of this error. Is there a way to define a planar 3D polygon type?