作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试使用 CGAL 库进行简单的 3D 转换,但显然我对语法感到困惑,因为无论我尝试什么,我都会遇到相同的编译时错误。这是一个最小的“非工作”示例:
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Vector_3.h>
#include <CGAL/Aff_transformation_3.h>
#include <CGAL/Aff_transformation_tags.h>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef Kernel::Vector_3 Vector_3;
typedef CGAL::Aff_transformation_3<Kernel> Aff_transformation_3;
int main(void)
{
Polyhedron P;
P.make_tetrahedron();
const Vector_3 transvec(-1,0,2);
Aff_transformation_3 transl(CGAL::Translation, transvec);
transform(P.points_begin(),P.points_end(),P.points_begin(),transl);
}
我尝试编译
g++ -O2 -frounding-math -I/usr/local/include -I/opt/local/include mwe.cc -Wl, -lCGAL -lCGAL_Core -lCGAL_ImageIO -lmpfr -lgmp -lm -o mwe
我总是收到这个错误:
mwe.cc:19:52: error: unknown type name 'transvec'
Aff_transformation_3 transl(CGAL::Translation, transvec);
最佳答案
CGAL::Translation
是一个类的名称——您需要 CGAL::TRANSLATION
,这是该类实例的名称。
关于c++ - CGAL 仿射变换的语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30039937/
我是一名优秀的程序员,十分优秀!