def three_d_print(self):
"""This will produce a 3d printable stl based on self.volume_data. It is to be used for the final "print" button, and needs to be fed high quality data."""
name = raw_input('What should the filename be?') + '.stl'
verts, faces = measure.marching_cubes(self.volume_data, 0) #Marching Cubes algorithm
solid = mesh.Mesh(np.zeros(faces.shape[0], dtype=mesh.Mesh.dtype))
for i, f in enumerate(faces):
for j in range(3):
solid.vectors[i][j] = verts[f[j],:]
solid.save(name)
#Here be UI
sculpture_gen.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录