cnr-isti-vclab/vcglib

Save function for ply format does not work correctly in some cases

ytSong74 opened this issue · 1 comments

Hi,

When I used the library, I noticed that sometimes the output ply mesh cannot be loaded in MeshLab. It will lead to an error "Bad vertex index in the face".
I noticed that this happens only when the format was set to binary. The possible cause is in line 196-197 of io_trimesh/export_ply.h file:

const char* vqtp = vcg::tri::io::Precision<typename VertexType::ScalarType>::typeName();
fprintf(fpout,"property %s quality\n",vqtp);

After correcting it to:

const char* vqtp = vcg::tri::io::Precision<typename VertexType::QualityType>::typeName();
fprintf(fpout,"property %s quality\n",vqtp);

, the output mesh can be loaded in my case.

I seems a correct change we will implement it soon, thanks!