CGAL:无法打开 .xyz 文件



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

我能够使用CMake制作它,并且可以使用Visual Studio构建和运行它,但是该程序在一开始就以"错误:无法读取文件数据/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;
}

这是 kitten.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

有人有想法吗?

谢谢!

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

最新更新