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

A problem in function"simple_3dviz.renderables.mesh.Mesh.from_file" #16

Open
xyx18061932 opened this issue Jul 10, 2023 · 0 comments
Open

Comments

@xyx18061932
Copy link

Hi simple-3dviz Team,
Thank you for your work on this Python module. I try to load an obj file using code:
"from simple_3dviz.renderables.mesh import Mesh
raw_mesh = Mesh.from_file("./s__1005.obj")"

then gives the following error which is similar to the previous issue :
File "/home/ubuntu/anaconda3/envs/atiss/lib/python3.8/site-packages/simple_3dviz/io/mesh.py", line 147, in extract_uv
return int(face.split("/")[1])-1
ValueError: invalid literal for int() with base 10: ''

I guess that because in the obj file, the "f" property is about
"f 66//64 73//71 75//68 69//65
f 69//65 75//68 72//67 67//66
f 79//74 88//87 90//86 82//75
f 82//75 90//86 87//85 80//78
f 67//66 79//74 84//77 70//63
f 81//80 65//60 70//63 84//77
f 88//87 72//67 77//70 91//84
f 91//84 77//70 74//73 86//81
f 93//88 102//99 104//98 96//89
f 96//89 104//98 101//97 94//91"
which uses "//" to divide the numbers rather than uses "/", I think this problem lead to the error.
But if I replace "//" with "/", the obj file can not be previewed as a jpg in pycharm with Wavefront OBJ module.

The obj file is as follows, could you please help me out?
s__1005.zip

Regards,
Xuan

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