isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.45k stars 2.31k forks source link

read_triangle_model --- read_triangle_mesh not compatible #5851

Open adamInThe80s opened 1 year ago

adamInThe80s commented 1 year ago

Checklist

Describe the issue

When using each of the methods

  1. read_triangle_model
  2. read_triangle_mesh

To load the same glb file, I am getting different number of vertices.

Is this a desired discrepancy?

Steps to reproduce the bug

import open3d as o3d

model_file = "model.glb"
mesh_model = o3d.io.read_triangle_model(model_file)
mesh_0 = mesh_model.meshes[0].mesh
mesh_1 = o3d.io.read_triangle_mesh(model_file)

len(mesh1.vertices) == len(mesh0.vertices)

Error message

False

Expected behavior

Expect the number of vertices to be the same.

Open3D, Python and System information

- Operating system: macOS 12.6.2 
- Python version: Python 3.9
- Open3D version: output from python: 0.16.1
- Is this a remote workstation?: no
- How did you install Open3D?: pip

Additional information

No response

hernot commented 1 year ago

Does any of the two have the same number of vertices as stored in the file? Does the order of vertices of any of the two appear changed compared to the order they have been in when stored? Possibly your case is another effect of weird loading approach of libassimp which open3d eat least uses under the hood of read_triangle_mesh uses to load glb and other files. Check if your symptoms are compareable what is reported for obj and stl (#6137 #2614, #6137)