#!/bin/env python3

from stl import mesh
from mpl_toolkits import mplot3d
from matplotlib import pyplot
import sys

# 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(sys.argv[1] )
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()

#!/bin/env python3

from stl import mesh
from mpl_toolkits import mplot3d
from matplotlib import pyplot
import sys

# 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(sys.argv[1] )
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()

#!/bin/env python3 # Create a new plot # Load the STL files and add the vectors to the plot # Auto scale to the mesh size # Show the plot to the screen