numpy-stl

Selection of Face of a STL by Face Normal value Threshold

こ雲淡風輕ζ 提交于 2020-01-14 07:08:32
问题 I want to write a script in Python which can generate facegroups in a STL as per the Face Normal value condition. For example, Provided is the snap of Stl, Different colour signifies the face group containing the triangular faces satisfying my given face normal threshold. Is there any simple way to do this in python? Face Group STL 回答1: I'm sure there's a python library to load stl files, but I've always just written my own, since the file format is pretty simple (see the Wikipedia article

Rendering 2D images from STL file in Python

好久不见. 提交于 2019-12-11 04:37:27
问题 I would like to load an STL file and produce a set of 2D images in different rotations. I got the basics working with numpy-stl based on this example, ended up with this code - from stl import mesh from mpl_toolkits import mplot3d from matplotlib import pyplot filename = '3001.stl' # Create a new plot figure = pyplot.figure() axes = figure.gca(projection='3d') # Load the STL files and add the vectors to the plot mesh = mesh.Mesh.from_file(filename) axes.add_collection3d(mplot3d.art3d