【CGAL_点云】点云读写与显示
读写并显示PLY点云
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Point_set_3.h> #include <CGAL/draw_point_set_3.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; typedef CGAL::Point_set_3<Point> Point_set;
int main() { Point_set point_set; if (!CGAL::IO::read_PLY("data/simple80_loss.ply", point_set)) { std::cerr << "Can't read input file!" << std::endl; return -1; } std::cout << "The number of points: " << point_set.size() << std::endl;
CGAL::draw(point_set);
CGAL::IO::write_point_set("data/simple80_loss.xyz", point_set);
return EXIT_SUCCESS; }
|