Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color values in OBJ file result in mangled vertex locations #338

Open
robonrrd opened this issue Nov 16, 2022 · 0 comments
Open

Color values in OBJ file result in mangled vertex locations #338

robonrrd opened this issue Nov 16, 2022 · 0 comments

Comments

@robonrrd
Copy link

robonrrd commented Nov 16, 2022

Bug found in PyMesh, built from source on Ubuntu 22.04, with Python 3.10.6.

Loading an OBJ file with vertex colors results in mangled vertex locations.

Repro example, using this data in a file named test.obj:

v 1.27705 0.03530 -1.38656 0.943 0.924 0.926                                                                
v 1.28410 0.04127 -1.38629 0.941 0.922 0.924                                                                
v 1.29420 0.03978 -1.38603 0.936 0.917 0.919                                                                
f 1 2 3
Python 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymesh
>>> m = pymesh.load_mesh('test.obj')
>>> m.vertices
array([[ 1.35424178,  0.03743372, -1.47037116],
       [ 1.36461211,  0.0438576 , -1.47320935],
       [ 1.38269231,  0.0425    , -1.48080128]])
>>> 

Removing the vertex colors (the trailing RGB triplet) allows the mesh to be loaded correctly.

Vertex colors are supported in the OBJ spec, so this is a bug in either PyMesh or a dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant