CGAL:无法打开.xyz文件

问题描述 投票:0回答:1

我正在使用CGAL示例example \ Poisson_surface_reconstruction_3 \ poisson_reconstruction_example.cpp。

我能够使用CMake制作它,并可以使用Visual Studio构建和运行它,但是程序在一开始就退出,并显示“错误:无法读取文件data / kitten.xyz”。我检查了一下,kitten.xyz文件在数据文件夹中,并且可以使用CloudCompare之类的软件打开。我还尝试了其他.xyz文件,但无法打开它们。

这是示例中使用的代码:

 PointList points;
    std::ifstream stream("data/kitten.xyz");
    if (!stream ||
        !CGAL::read_xyz_points(
                              stream,
                              std::back_inserter(points),
                              CGAL::parameters::point_map (Point_map()).
                              normal_map (Normal_map())))
    {
      std::cerr << "Error: cannot read file data/kitten.xyz" << std::endl;
      return EXIT_FAILURE;
    }

这是kitchen.xyz文件的前几行:

-0.0721898 -0.159749 -0.108444 0.340472 0.937712 -0.0690972
0.145233 -0.163455 0.107108 0.821548 0.302589 0.483218
0.126784 -0.175123 -0.0474613 0.625688 0.275329 -0.729869
-0.0481776 -0.165903 -0.0696537 0.304957 0.95168 0.0361474
-0.061821 -0.160092 -0.0798811 0.303781 0.952723 0.00601667

有人有想法吗?

谢谢!

c++ cgal xyz
1个回答
0
投票

就我而言,我没有将数据文件夹复制到构建目录中,因此无法找到并打开.xyz文件。

© www.soinside.com 2019 - 2024. All rights reserved.