Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • OpenMesh OpenMesh
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenMeshOpenMesh
  • OpenMeshOpenMesh
  • Issues
  • #60
Closed
Open
Issue created Nov 27, 2018 by Jan Möbius@moebiusOwner

OBJ Writer/Reader Issue

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::Options ropt;

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))

{

    return false;

}


_mesh.update_normals();

To save the mesh, I'm doing:

OpenMesh::IO::Options wopt;

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))

    return true;

There have been no modifications to the file.

Assignee
Assign to
Time tracking