Компас 3d. Python. Чтение Stl.

Опубликовано: 24 Июль 2026
на канале: COMPASS - 3D
1,088
18

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('6.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()