27#include <easy3d/core/point_cloud.h>
28#include <easy3d/fileio/point_cloud_io.h>
29#include <easy3d/util/resource.h>
30#include <easy3d/util/initializer.h>
41int main(
int argc,
char** argv) {
46 PointCloud* cloud = PointCloudIO::load(resource::directory() +
"/data/bunny.bin");
48 LOG(ERROR) <<
"failed to load model. Please make sure the file exists and format is correct.";
52 std::cout <<
"point cloud has " << cloud->
n_vertices() <<
" points" << std::endl;
57 std::ofstream output(
"./bunny-copy.txt");
58 if (output.is_open()) {
65 std::cout <<
"saving the point cloud..." << std::endl;
70 output <<
" " << normals[v];
72 output <<
" " << colors[v];
75 std::cout <<
"point cloud saved to './bunny-copy.txt'" << std::endl;
Vertex property of type T.
Definition: point_cloud.h:107
A data structure for point clouds.
Definition: point_cloud.h:45
VertexContainer vertices() const
returns vertex container for C++11 range-based for-loops
Definition: point_cloud.h:444
VertexProperty< T > get_vertex_property(const std::string &name) const
get the vertex property named name of type T. returns an invalid VertexProperty if the property does ...
Definition: point_cloud.h:340
unsigned int n_vertices() const
returns number of vertices in the cloud
Definition: point_cloud.h:279
Definition: collider.cpp:182
void initialize(bool use_log_file, bool use_setting_file, const std::string &resource_dir)
Initialization of Easy3D.
Definition: initializer.cpp:35