Read Binary Mesh

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Read Binary Mesh

Hilarius
Hi all,

up until now I worked with:

pcl::PolygonMesh mesh;
const std::string filename = "filename.obj";
pcl::io::loadOBJFile(filename, mesh);

to load my mesh for processing.

To speed up this loading progress I'd like to switch from OBJ to a binary file. My first test format was binary PLY which I generated in CloudCompare. But sadly when I load the PLY with

pcl::io::loadPLYFile(filename, mesh);

I get an empty cloud.

Are there any other file formats?

What possibilities exist to load a binary mesh in PCL? I am working with Win7 x64, VS2012 and 1.7.2 at the moment.

Greetings
Felix
Reply | Threaded
Open this post in threaded view
|

Re: Read Binary Mesh

Sérgio Agostinho
Hey, 

The PLY, STL and VTK formats support meshes and can save and load binary files. I have the impression the PLY writer has bug when writing meshes, but haven't had time to verify it, so for the time being I would suggest using pcl_converter to convert your original OBJ mesh into one of the available formats.

pcl_converter -h for more displaying help. 

Cheers, 
Sérgio

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Read Binary Mesh

Hilarius
Hi Sérgio,

I already got the binary PLYs but I couldn't open those.

Thanks anyway for your remarks. It pointed me to the ply_ply2obj tool and the loadPolygonFilePLY function. If I use that function it works as intended.

Guess the loadPLYFile doesn't work on binary- but only with ascii PLY when faces are involved.

Cheers,
Felix
Reply | Threaded
Open this post in threaded view
|

Re: Read Binary Mesh

VictorLamoine
Administrator
Hello,

The loadPLYFile works with binary files too, can you upload a sample file not working?

Bye
Reply | Threaded
Open this post in threaded view
|

Re: Read Binary Mesh

Hilarius
I just changed back to loadPLYFile and even kicked #include <pcl/io/vtk_lib_io.h> out of my code, but I can't reproduce the behavior on 2 PLY files, that didn't work before. The meshes are loaded fine with both functions now...

Thanks for your help, now I am really lost for words. If I can reproduce my problem at any point, I will post sample code and files.