Menu

#85 Coordinates rounded to next hundreth when writing out ply file

open
nobody
5
2014-12-11
2014-12-11
Adrian
No

When writing out ply files, the coordinates are written out using 6 digits maximum. If there are 4 digits before the comma, there are only two digits left for after the comma. This is a big problem when handling grids expressed in m where the origin is often more than 1km away (due to georeferencing), as this reduces the resolution to cm.
At least 3 (ideally 4) digits after the comma are required

I belive this is very easily fixable. If my understanding of MeshLab is correct, the vcg library is used to write out ply files. In export_ply.h (available at http://docs.ros.org/diamondback/api/vcglib/html/io__tetramesh_2export__ply_8h_source.html ) data is written to a text file on line 360:
fprintf(fpout,"%g %g %g " ,vp->P()[0],vp->P()[1],vp->P()[2]);

Replacing the %g by %.4g or %.4f should solve the above described issue.
If vcg library and MeshLab were easy to compile I would actually do that myself, but it turns out it is not so simple.

Discussion


Log in to post a comment.