Hi,
i added an issue for this problem:
https://graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/issues/60
i also added a unittest with your code in a Test_OBJ_Texcoord branch:
https://graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/commits/Test_OBJ_Texc...
The tests seem fine: https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/pipelines/7914
Can you send me the intermediate file written by OpenMesh?
Best, Jan Möbius
On 27.11.18 10:34, Jan-Michael Tressler wrote:
Hi all,
I found an issue regarding the OBJ writer and saving Face TexCoords.
Basically, what I'm seeing is that the OBJ writer is adding extra vt entries into the OBJ file. The file still works in Meshlab if I add the missing MTL header to the top of the OBJ file, but I'm unable to reopen the file using OpenMesh.
The error I'm getting is "Only single 2D or 3D texture coordinate per vertexallowed!". From what I'm seeing, the new OBJ file has (in my case) an additonal 983 VT entries.
To open the mesh, I'm doing:
OpenMesh::IO::Optionsropt;
ropt += OpenMesh::IO::Options::FaceTexCoord;
_mesh.request_vertex_normals();
_mesh.request_face_normals();
_mesh.request_halfedge_texcoords2D();
if (!OpenMesh::IO::read_mesh(_mesh, path, ropt))
{
returnfalse;
}
_mesh.update_normals();
To save the mesh, I'm doing:
OpenMesh::IO::Optionswopt;
if(_mesh.has_vertex_normals())
{
wopt += OpenMesh::IO::Options::VertexNormal;
}
if(_mesh.has_halfedge_texcoords2D())
{
std::cout << "has 2d" << std::endl;
wopt += OpenMesh::IO::Options::FaceTexCoord;
}
if (!OpenMesh::IO::write_mesh(_mesh, path, wopt))
returntrue;
There have been no modifications to the file.
Thanks for your help, Jan-Michael
OpenMesh mailing list -- openmesh@lists.rwth-aachen.de To unsubscribe send an email to openmesh-leave@lists.rwth-aachen.de https://lists.rwth-aachen.de/postorius/lists/openmesh.lists.rwth-aachen.de