Why do items set to export as OBJ export as low resolution triangular meshes?

Why do items set to export as OBJ export as low resolution triangular meshes?

christopher.pepin
Advocate Advocate
387 Views
7 Replies
Message 1 of 8

Why do items set to export as OBJ export as low resolution triangular meshes?

christopher.pepin
Advocate
Advocate

My understanding is that OBJ files are capable of storing actual curved faces instead of having to resort to an ever increasing number of triangles. When you open the options when exporting to OBJ your resolution options are [low medium high custom BREP]. This would seem to imply that if you choose BREP Inventor should export the actual faces but in reality it doesn't seem to do that.

 

For example I created a simple cylinder 1 in wide and exported it as an OBJ using both the BREP and Low resolution options. When opened in Code both files are identical save for the metadata referring to the name of the  texture file. Absolutely no attempt to save any of the surfaces as actual surfaces seems to be made.

 

I can only attach the two examples but I actually exported in every resolution and none of the resulting files varied. I tried exporting a simple cube, which the documentation at https://www.martinreddy.net/gfx/3d/OBJ.spec even uses as one of the things possible with OBJs, and it still turns into triangles for no apparent reason.

0 Likes
388 Views
7 Replies
Replies (7)
Message 2 of 8

kacper.suchomski
Mentor
Mentor

Hi

Where do you get your assumption that OBJ format represents curves?

https://en.wikipedia.org/wiki/Wavefront_.obj_file


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 3 of 8

christopher.pepin
Advocate
Advocate

It says so right in the Wikipedia article you linked.


Face elements

Faces are defined using lists of vertex, texture and normal indices in the format vertex_index/texture_index/normal_index for which each index starts at 1 and increases corresponding to the order in which the referenced element was defined. Polygons such as quadrilaterals can be defined by using more than three indices.

OBJ files also support free-form geometry which use curves and surfaces to define objects, such as NURBS surfaces.

 

 


The reference I linked bears that out as well and even gives specific examples, including an example of how a cube should be represented as six full faces, which is what a brep version of a cube should translate to.

2.      Cube

This is a cube that measures two units on each side. Each vertex is
shared by three different faces.

    v 0.000000 2.000000 2.000000
    v 0.000000 0.000000 2.000000
    v 2.000000 0.000000 2.000000
    v 2.000000 2.000000 2.000000
    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    f 1 2 3 4
    f 8 7 6 5
    f 4 3 7 8
    f 5 1 4 8
    f 5 6 2 1
    f 2 6 7 3

 





Message 4 of 8

pcrawley
Advisor
Advisor

Unfortunately, I think the answer is in the Help file (https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=GUID-68FCAD0E-93BD-4D90-B9FE-9CF82AA4E64D).  It looks like you can only export OBJs as triangular meshes.

 

I've often wondered why OBJ's were only triangular meshes from Inventor.  Thanks for helping me understand why. 

 

Maybe the BREP export option could be renamed - or at least changed to "Brep (Mesh only)"

pcrawley_2-1743565433516.png

 

From the Help file:

 

Resolution Controls resolution to use for exporting the model. Sets preset percentage values for sliders in options that control tessellation for the exported file.

  • High - Parameters use the high preset percentage values. For Surface Deviation, Max Edge Length, or Aspect Ratio, selection clears if values change.
  • Medium - Parameters use the medium preset percentage values.
  • Low - Parameters use the low preset percentage values.
  • Custom - Specifies user-defined values.
    Note: For the above, a tolerance setting that is too tight can result in excessive facets and depletion of memory. In this case, the operation can fail.
  • BREP (default) - Outputs a boundary representation made up of faces, edges, and vertices.

Surface Deviation Controls the maximum distance between the facet edges and the surface edges. Specifies the surface deviation parameter to use for tessellation. If you adjust the slider, the resolution changes to Custom.

 

Normal Deviation Controls the maximum angle between the normal vectors of the facets. Specifies the normal deviation parameter to use for tessellation. If you adjust the slider, the resolution changes to Custom.

 

Max Edge Length Defines the maximum distance between the grid lines that are placed on the face during the tessellation process. Specifies the maximum edge length parameter to use for tessellation. If you adjust the slider, the resolution changes to Custom.

 

Aspect Ratio Controls the ratio between the height and width of the facets. Specifies the aspect ratio parameter to use for tessellation. If you adjust the slider, the resolution changes to Custom.

Peter
Message 5 of 8

christopher.pepin
Advocate
Advocate

That doesn't really explain why a cube gets needlessly faceted when exported. It should be able to export as a set of eight vertexes, twelve edges and six faces and the help file would suggest that selecting BREP should do that but it doesn't. It still needlessly facets it. If even flat faces get split into triangles how is it any different than the other settings. At that point it is just a custom resolution option with undefined parameters.

 

It also doesn't explain why the three resolutions settings come out the same with my cylinder. Like I said the files are byte for byte identical. They aren't similar, they are the same. Selecting High resolution did not produce a mesh with any higher resolution than the Low setting and it is not like the mesh it produced was already a high resolution mesh. I don't have access to my laptop today so I can't test any other files but even with just the simple cylinder, if what it output was the highest resolution it can achieve then it is in a pretty sorry state as there was still visible faceting from a distance.

0 Likes
Message 6 of 8

christopher.pepin
Advocate
Advocate

It looks like the answer is actually much simpler. It seems the entire obj exporter is a lie. I did more tests and no matter what I exported or what options I choose every file came out the same. A benchy with all the dials maxed out exports exactly the same as a benchy with the dials minimized or the options set to high or set to low or brep. None of the options mean anything.

0 Likes
Message 7 of 8

kacper.suchomski
Mentor
Mentor

Is there anything stopping me from exporting to stl instead of obj?


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 8 of 8

christopher.pepin
Advocate
Advocate

It seems to me the only reason to even consider exporting as an obj at this stage is that the obj file does still add a mtl file with color data for the part. If you don't need color data it appears to simply be a worse version of the stl export. It is very disappointing because true objs have a lot of potential.

0 Likes