Using plotly to visualize mesh
- Python
from meshlib import mrmeshpy as mm
from meshlib import mrmeshnumpy as mn
import numpy as np
import plotly.graph_objects as go
mesh = mm.loadMesh("mesh.stl")
verts = mn.getNumpyVerts(mesh)
faces = mn.getNumpyFaces(mesh.topology)
verts_t = np.transpose(verts)
faces_t = np.transpose(faces)
fig = go.Figure(data=[
go.Mesh3d(
x=verts_t[0],
y=verts_t[1],
z=verts_t[2],
i=faces_t[0],
j=faces_t[1],
k=faces_t[2]
)
])
fig.show()
Plotly visualization