我正在使用 numpy-stl 在绘图中打开 stl 文件。它是打开的 stl 文件。但我有一个问题。我想像这样在图中旋转 stl 文件:
代码在这里:
from stl import mesh
from mpl_toolkits import mplot3d
from matplotlib import pyplot
from math import sin,cos,pi
import numpy as np
# Create a new plot
figure = pyplot.figure()
axes = mplot3d.Axes3D(figure)
m1 = mesh.Mesh.from_file('filea.stl')
axes.add_collection3d(mplot3d.art3d.Poly3DCollection(m1.vectors))
# Auto scale to the mesh size
scale = m1.points.flatten()
axes.auto_scale_xyz(scale-10, scale+10, scale)
# Show the plot to the screen
pyplot.show()