1

I have a mesh stored in an obj file and I need to plot it using plotly.graph_objs. Is there a way I can do it? I need to use graph_objs because I need to display the mesh together with some scatter plot.

You can download the Stanford bunny from here.

albus_c
  • 6,292
  • 14
  • 36
  • 77

1 Answers1

1

An obj file can be read with meshio, https://github.com/nschloe/meshio. Once the mesh has been read, you can extract the triangles and the triangle vertex coordinates, from which you can get data to be passed to the constructor of the Plotly go.Mesh3d class. This notebook https://nbviewer.org/github/empet/Hollow-mask-illusion/blob/main/Hollow-Mask-illusion-Animation.ipynb illustrates both a triangulated mesh, and a filled mesh.

xecafe
  • 740
  • 6
  • 12