angeloskath / simple-3dviz

A library for 3D visualization with moderngl
http://simple-3dviz.com/
Other
130 stars 21 forks source link

Loading OBJ file from ShapeNet fails #13

Open HanG-94 opened 1 year ago

HanG-94 commented 1 year ago

Hi simple-3dviz Team, when i try to load .obj file from ShapeNet using Mesh.from_file("model_normalized.obj") then gives following error:

File ~/miniconda3/lib/python3.10/site-packages/simple_3dviz/io/mesh.py:147, in ObjMeshReader.read..extract_uv(face) 146 def extract_uv(face): --> 147 return int(face.split("/")[1])-1

ValueError: invalid literal for int() with base 10: ''

The version of simple-3dviz is 0.7.0. The .obj file i list here: model_normalized.zip

could you please help me out?

Regards, Han Gao

HanG-94 commented 1 year ago

Dear simple-3dviz Team,

i think the obj from ShapeNet.v2 consists of multiple models, which cannot be loaded by Mesh.from_file(). A possible workaround could be using the trimesh.load(file, force='mesh').

Regards, Han

paschalidoud commented 1 year ago

Hi @HanG-94,

Thanks a lot for using our library. Do you mind sharing the obj file you that causes the ValueError?

Best, Despi