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

Exported OBJ can have invalid face format #391

Closed
timhutton opened this issue Jan 2, 2020 · 3 comments
Closed

Exported OBJ can have invalid face format #391

timhutton opened this issue Jan 2, 2020 · 3 comments

Comments

@timhutton
Copy link

This file was produced by Wings3D: knotty01.zip

Opening it in ParaView gives this error:

ERROR: In C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\IO\Geometry\vtkOBJReader.cxx, line 590
vtkOBJReader (00000159E9F42C60): Error reading file near line 1352 while processing the 'f' command

The offending line is:

f 1// 6// 1343// 1296//

(the first 'f' face line)

It seems that this should be:

f 1 6 1343 1296

since this is a face without texture coordinates or normals. See:

The same thing seems to have caused issues with other software previously: http://www.wings3d.com/forum/showthread.php?tid=865

Thoughts?

Context: I'm not a Wings3D users but have had this issue reported as a downstream user of VTK, which ParaView also uses.

@Micheus
Copy link
Collaborator

Micheus commented Jan 3, 2020

Hi @timhutton thanks for report that.

As far as I know, the exporter tries to be in accordance with the OBJ specification once it states that (in the file you referenced - as well as me in that forum's thread):

If there are only vertices and vertex normals for a face element (no
texture vertices), you would enter two slashes (//). For example, to
specify only the vertex and vertex normal reference numbers, you would
enter:

f 1//1 2//2 3//3 4//4

And - because others 3D Apps can read it without any problem - I can not think it would be wrong in that approach. (I could open it in these: ZBrush, Blender, MeshLab, InstantMesh, MS Paint 3D, 3D Converter, Assimp Viewer).

So, I tend to think that these small portion of apps that don't process those "// " as face without texture and normal information may have a different understanding of the specification.

Something that I suggest in that thread can help the users in these cases:

In the export dialog you can set Export normals/smoothing group

I just tried it with ParaView and the object was successfully loaded.

@dgud
Copy link
Owner

dgud commented Feb 16, 2020

I would not classify this a bug in wings, IMHO that syntax should be valid.
Though I agree that it unnecessary to output them, have not looked at the code to see hard
it would be to fix though.

Also wings3d have exported OBJ files in this format since 2000 and we have only have had two importers that could not handle trailing '//'. So I would classify this as a bug in the importer lib.

@dgud
Copy link
Owner

dgud commented Feb 18, 2020

So I discussed this with Björn and trough the years there have only been complaint on two
occasions, and if we change the behavior now we might break more applications.
So we decided to not change this until more complaints appear.

@dgud dgud closed this as completed Feb 18, 2020
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

3 participants