Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
OpenMesh
OpenMesh
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenMesh
  • OpenMeshOpenMesh
  • Issues
  • #60

Closed
Open
Opened 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
OpenMesh 8.0
Milestone
OpenMesh 8.0
Assign milestone
Time tracking
None
Due date
None
Reference: OpenMesh/OpenMesh#60