#include \n#include <pcl/io/ply_io.h>\n#include <pcl/point_types.h>\n\nint main()\n{\n // 创建一个点云对象\n pcl::PointCloudpcl::PointXYZ::Ptr cloud(new pcl::PointCloudpcl::PointXYZ);\n\n // 添加一些点到点云中\n for (float x = -1.0; x <= 1.0; x += 0.1)\n {\n for (float y = -1.0; y <= 1.0; y += 0.1)\n {\n for (float z = -1.0; z <= 1.0; z += 0.1)\n {\n pcl::PointXYZ point;\n point.x = x;\n point.y = y;\n point.z = z;\n cloud->push_back(point);\n }\n }\n }\n\n // 输出点云的三维坐标到PLY文件\n pcl::io::savePLYFile("point_cloud.ply", *cloud);\n\n std::cout << "Point cloud saved as point_cloud.ply" << std::endl;\n\n return 0;\n}

C++ PCL库:输出PLY文件所有点的三维坐标

原文地址: https://www.cveoy.top/t/topic/prHN 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录