Hi!
I was trying to export a TriMesh to the PLY file format with vertex colors.
The mesh looks as expected in OpenFlipper. But the exported mesh was all
black in MeshLab. When looking at the PLY file, the components of the
colors were all either 0 or 1.
I believe there is a bug in the PLY exporter. TriTraits::Color is
defined as Vec4f. FilePLYT.cc exports this as
ofs << " " << OpenMesh::color_cast<OpenMesh::Vec3i>(c);
That means, that in fact OpenMesh::color_coder<Vec3i, Vec4f> is used for
the conversion. Since there is no such specialization of color_coder,
the default template will be used, which just converts to int. Thus, the
resulting colors will all be not correct.
Shouldn't it be this?
ofs << " " << OpenMesh::color_cast<OpenMesh::Vec3uc>(c);
Bye,
Bengt