C++ 3个平面与cgal的交点
我用cgal编码得到3个平面的交点 然后我有了这个密码C++ 3个平面与cgal的交点,c++,boost,cgal,C++,Boost,Cgal,我用cgal编码得到3个平面的交点 然后我有了这个密码 Plane_3 suelo(Point_3(0,0,0), Vector_3(0,0,-1)); Plane_3 principal( Point_3(0,0,0),Vector_3(0,1,0)); Plane_3 lateral3(Point_3(0,5,0),Vector_3(-1,0,0)); boost::optional<boost::variant<Point_3, Line_3, Plane_3&g
Plane_3 suelo(Point_3(0,0,0), Vector_3(0,0,-1));
Plane_3 principal( Point_3(0,0,0),Vector_3(0,1,0));
Plane_3 lateral3(Point_3(0,5,0),Vector_3(-1,0,0));
boost::optional<boost::variant<Point_3, Line_3, Plane_3>> res = CGAL::intersection(suelo, principal, lateral3);
if (res!=boost::none)
{
qDebug(" TRACKING 001 ");
qDebug("\n");
if (const Plane_3* pl = boost::get<Plane_3>(&(*res)))
{
qDebug(" TRACKING 002 ");
qDebug("\n");
}
else if ( const Line_3* l = boost::get<Line_3>(&(*res)))
{
assert(l!=NULL);
qDebug(" TRACKING 003 ");
qDebug("\n");
}
else if ( const Point_3* p = boost::get<Point_3>(&(*res)))
{
qDebug(" TRACKING 004");
std::cout<<"el punto es:"<<p<<std::endl;
qDebug(" TRACKING 005");
K_01::RT y = p->y();
std::cout<<"el punto y es:"<<p->y()<<std::endl;
qDebug(" TRACKING 006");
std::cout<<"el punto x es:"<<p->x()<<std::endl;
qDebug(" TRACKING 007");
}
}
平面_3suelo(点_3(0,0,0),向量_3(0,0,-1));
平面_3主(点_3(0,0,0),向量_3(0,1,0));
平面_3侧向3(点_3(0,5,0),向量_3(-1,0,0));
boost::optional res=CGAL::intersection(suelo,principal,lateral3);
if(res!=boost::none)
{
qDebug(“跟踪001”);
qDebug(“\n”);
if(const Plane_3*pl=boost::get(&(*res)))
{
qDebug(“跟踪002”);
qDebug(“\n”);
}
else if(const Line_3*l=boost::get(&(*res)))
{
断言(l!=NULL);
qDebug(“跟踪003”);
qDebug(“\n”);
}
else if(const Point_3*p=boost::get(&(*res)))
{
qDebug(“跟踪004”);
标准::cout