简体   繁体   中英

Plot mesh from .obj file using plotly.graph_objs

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM