sculpture_gen.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Simple-User-Input-Sculpture-Generation 作者: ClaireKincaid 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号