I am trying to calculate the nearest segment from another segment in a 3-dimensional space using the boost::geometry::index::nearest
query on a boost:: boost::geometry::index::rtree
but I get the following compilation error:
error C2664: 'boost::mpl::assertion_failed' : cannot convert parameter 1 from 'boost::mpl::failed ************(__cdecl boost::geometry::nyi::not_implemented_error::THIS_OPERATION_IS_NOT_OR_NOT_YET_IMPLEMENTED::* ***********)(boost::mpl::assert_::types)' to 'boost::mpl::assert::type'
I have managed to narrow down the same issue to using just the boost::geometry::distance
function:
typedef boost::geometry::model::point <float, 3, boost::geometry::cs::cartesian> point;
typedef boost::geometry::model::segment <point> segment;
point pa = point(x1, y1, z1);
point pc = point(x2, y2, z2);
point pb = point(x3, y3, z3);
float dist = boost::geometry::distance(segment(pa, pb), segment(pa, pc));
According to the documentation of the version of Boost I'm using (1.60) this should be supported, however it works just fine when using two dimensions.
I could not find anything in the docs either about how to extend the functionality or whether it's possible at all.