是否有一种计算CGAL中Surface_mesh对象的PCA的方法
Is there a method to compute pca of a Surface_mesh object in CGAL?
我是CGAL库的新手。我想计算Surface_mesh对象的PCA。
CGAL::Surface_mesh<Kernel::Point_3> mesh;
std::ifstream cactus("cat.off");
cactus >> mesh;
正如我在计算PCA的CGAL文档中提到的那样,此处讨论了一组点或三角形的PCA。
我尝试了鲍泽代码以适合一条线,但是提出了错误:
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <iostream>
#include <fstream>
#include <sstream>
typedef double FT;
typedef CGAL::Simple_cartesian<FT> K;
typedef K::Line_3 Line;
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Surface_mesh<Kernel::Point_3> SM;
int main(void)
{
Line line;
SM mesh;
std::ifstream cat("cat.off");
cat >> mesh;
linear_least_squares_fitting_3(mesh.faces_begin(),mesh.faces_end(),line, CGAL::Dimension_tag<0>());
return 0;
}
传递给linear_leastrongquares_fitting_3的迭代器的值类型只能是几何内核类型。但是,您可以构造Triangle_3
的向量并将此范围传递给该函数,也可以将Boost的转换器与简单的结构结合使用,该结构从Surface_mesh
的脸部构造Triangle_3
。
相关文章:
- mesh.delete_face() 导致中止()
- 关于 Vulkan 并使用 GLFW 抽象出 Surface 创建
- Surface Pro平板电脑上的QML应用程序键盘行为
- 创建Mesh类并实现不会生成模型OpenGL
- Qt3D:"Mesh is empty, nothing to load"消息
- 无法在"surface input"模式下使用 Android 平台的 MediaCodec 类
- 如何在CGAL中加载Coff Mesh
- 不能使用 vkCreateWin32SurfaceKHR 创建 vulkan surface
- OpenCV可以从Surface Pro相机捕获图像Microsoft
- SDL2-从Surface(屏幕快照)创建纹理的问题
- 使用 Qt c++ 在 Windows Surface Pro 上获取加速度计数据
- 重写 contiki 源代码“example-mesh.c”以根据计时器值发送消息
- 如何修复'class android::Surface'没有名为"setDirtyRect"的成员?
- SurfaceTexture/Surface mapping with ANativeWindow
- OpenGL 打开 Mesh (.m) 文件与 Visual Studio2010
- 来自 SDL Surface 的 openGL 纹理
- DirectX — 有没有类似 DirectDraw surface Flip() 的类似物
- 类型 'Mesh *' 的参数与类型 'Mesh *' 的参数不兼容
- std::unique_ptr<Mesh>::unique_ptr(__gnu_cxx::__alloc_traits<std:::分配器<Mesh> >::val
- 我可以在Surface RT上运行Windows 2003 SDK应用程序吗