alicevision / geogram

Git mirror of the geogram library by INRIA
https://github.com/BrunoLevy/geogram
BSD 3-Clause "New" or "Revised" License
123 stars 54 forks source link

Opening ply pointclouds #10

Closed UannaFF closed 2 years ago

UannaFF commented 5 years ago

Hello, I'm trying to do a simple co3n reconstruction from a pointcloud that has normals already. When I try to open the pointcloud it tells me the extension is not supported but when i use vorpaline example it works. How can I open a .ply file?

// Declare a mesh. GEO::Mesh M;

// Load the mesh and display timings.
GEO::Logger::div("Loading");
{
    GEO::Stopwatch W("load");
    if(!GEO::mesh_load("./cloudwithnormals.ply", M)) {
        return 1;
    }
}

GEO::Co3Ne_reconstruct  (M,0.02);

// Save the mesh and display timings.    
GEO::Logger::div("Saving");
{
    //GEO::Stopwatch W("save");        
    if(!GEO::mesh_save(M,"./meshCo3Ne.ply")) {
        return 1;
    }
}

This is the only thing I have for the moment. I'm getting the following error:

=====Command line [MyApp] Opening mesh with geogram: ./cloudwithnormals.ply =====Loading [I/O] Loading file ./cloudwithnormals.ply... (E)-[I/O] Unsupported file format: ply (E)-[I/O] Could not load file: ./cloudwithnormals.ply [load] Elapsed time: 0 s

hadjiszs commented 5 years ago

you may have forgotten to call GEO::initialize()

duandongbin000 commented 4 years ago

Hello, have you solved the problem ? i use GEO::mesh_load() to input ply, but return false.