抱歉打擾各位
我目前作業環境為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()