stl_from_points.py 文件源码

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

项目:tilt-editor 作者: bonus85 项目源码 文件源码
def main(opts):

    vertices = np.genfromtxt('points.dat', delimiter=' ', skip_header=1)

    npoints, dim = vertices.shape

    assert dim == 3

    faces = np.genfromtxt('indices.dat', delimiter=' ') # Generated from alpha_shape

    # Create the mesh
    cube = mesh.Mesh(np.zeros(faces.shape[0], dtype=mesh.Mesh.dtype))
    for i, f in enumerate(faces):
        for j in range(3):
            cube.vectors[i][j] = vertices[f[j],:]

    # Write the mesh to file
    cube.save(opts.new_file_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号