抱歉打扰各位
我目前作业环境为Ubuntu 16.04
套件用conda 管理
今天想要尝试numpy-stl套件
下述范例读取.stl档
使用Vs code 却有ImportError: No module named stl
但是我在vs code里终端机里打conda list有看到numpy-stl
所以我是那边没有设定好?
读取范例程式码:
from stl import mesh
from mpl_toolkits import mplot3d
from matplotlib import pyplot
# Create a new plot
figure = pyplot.figure()
axes = mplot3d.Axes3D(figure)
# Load the STL files and add the vectors to the plot
your_mesh = mesh.Mesh.from_file('/home/chen/sample3.stl')
axes.add_collection3d(mplot3d.art3d.Poly3DCollection(your_mesh.vectors))
# Auto scale to the mesh size
scale = your_mesh.points.flatten(-1)
axes.auto_scale_xyz(scale, scale, scale)
# Show the plot to the screen
pyplot.show()