wentaoyuan/pcn

vtkOBJReader in sample.cpp not reading the whole mesh

Closed this issue · 5 comments

mesh_sampling.cpp

Yes. There is a problem with vtkOBJReader while reading some ShapeNet models where parts of the model has tcoords/normals and other parts don't. I don't know if they have fixed that in the latest version. I solved this issue by adding the following code after line 956 in vtkOBJReader.cxx and rebuild VTK.

// Here we turn off texturing and/or normals
if (n_tcoord_pts == 0)
{
  hasTCoords = false;
}
if (n_normal_pts == 0)
{
  hasNormals = false;
}

Yes. There is a problem with vtkOBJReader while reading some ShapeNet models where parts of the model has tcoords/normals and other parts don't. I don't know if they have fixed that in the latest version. I solved this issue by adding the following code after line 956 in vtkOBJReader.cxx and rebuild VTK.

// Here we turn off texturing and/or normals
if (n_tcoord_pts == 0)
{
  hasTCoords = false;
}
if (n_normal_pts == 0)
{
  hasNormals = false;
}

I'm using VTK 8.2.0, this code is useful, however, it shuld locate after line 858.

@gillbam Hi, I am also using VTK 8.2.0 and rebuild it after adding the code above, however I am still getting errors mentioned in #40 . Do you have that issue?

@gillbam NVM I have fixed that. Thanks for the direction of VTK 8.2.0.