Is there way to convert the stl file content into a numpy array or a set of numpy arrays?
I know that I can always read stl as file and then assign variables, but I was wondering if there is an automated way!
Try the numpy-stl package.
After doing pip install numpy-stl
:
import numpy
from stl import mesh
# Using an existing stl file:
your_mesh = mesh.Mesh.from_file('some_file.stl')