我有stl文件和numpy-stl库。网格类本身具有 .x,.y,.z 属性,可以对其进行绘制
my_mesh = mesh.Mesh.from_file(file)
x = my_mesh.x
y = my_mesh.y
z = my_mesh.z
mlab.points3d(x, y, z)
mlab.show()
结果缓慢且视觉效果很差
还具有 vectors 属性,但是我不知道如何使用它。 在matplotlib中,我可以使用:
figure = plt.figure()
axes = mplot3d.Axes3D(figure)
axes.add_collection3d(mplot3d.art3d.Poly3DCollection(my_mesh.vectors))
plt.show()
结果
是工作财产,但速度非常慢,几乎无法使用。
是否有更好的方法进行绘制?