Visualize 3D models saved as Wavefront .OBJ files

Hello. What would be an optimal way to visualize 3D objects saved as Wavefront .OBJ files ?
Wavefront .OBJ file wikipedia
Say, I can read the .OBJ files with the PyWavefront package, but what would be the next steps?
Any suggestions?
Or probably there are other file formats for 3D modeling, which would be a better choice to work with Plot.ly.
Thank you.

Hi @vasily,

I think you could get most of the way there using the mesh3d trace type. This allows you to specify the x/y/z coordinates of a vertex list, and then arrays of the i/j/k indices into the vertex lists to define the triangles.

I’m not very familiar with the details of the obj format, but from looking the the wikipedia link briefly, it looks like wafefront files support arbitrary polygons, whereas mesh3d only supports triangles. So one thing you may need to do is triangulate the polygons.

Another consideration is that mesh3d support coloring on a per triangle basis using facecolor and it won’t support all of the texture options that obj files have.

Hope that helps get you started!

-Jon

@vasily

Take a look at this notebook https://plot.ly/~empet/15040/plotly-mesh3d-from-a-wavefront-obj-f/#/, I posted for a similar question addressed here a while ago: https://community.plot.ly/t/view-3d-cad-data/16920.

1 Like

Thank you @empet and @jmmease for your reply!
I was expecting something like that - just wondering if I was missing some key standard approaches.
@jmmease I appreciate your comments and suggestions!
@empet Somehow I did not find your post. Thank you for your notes! It is very helpful.

Related:
“OBJ export options for isosurface engine and volume”

I am quite familiar with .OBJ format. And I think this ticket is related to improting the OBJ files into Plotly ecosystem, possibly as a new trace type?
@alexcjohnson also cc: @maxt

Hey,
I made a python package to import wavefront obj files into 3dmesh.
A work in progress (part of a larger project) but it works!
[https://pypi.org/project/dash-obj-in-3dmesh/](http://pypi link )

Thank you for this idea,
ust question please. In case we have the *.mtl file for the texture can we loaded in the plotting figure