Exemplo n.º 1
0
    if voxel_space[1] != 'P':
        new_vertice[:,1] = -new_vertice[:,1]
    if voxel_space[2] != 'S':
        new_vertice[:,2] = -new_vertice[:,2]
    mesh.set_vertices(new_vertice)
    
if args.fx or args.fy or args.fz:
    flip = [-1 if args.fx else 1, 
            -1 if args.fy else 1,
            -1 if args.fz else 1]
    print "flip:", flip
    f_triangles, f_vertices = mesh.flip_triangle_and_vertices(flip)
    mesh.set_vertices(f_vertices)
    mesh.set_triangles(f_triangles)

# smooth
if args.smooth is not None:
    new_vertice = mesh.laplacian_smooth(1, args.smooth, l2_dist_weighted=False, area_weighted=False, backward_step=True)
    mesh.set_vertices(new_vertice)

if args.out_surface is not None:
    mesh.save(args.out_surface)
    
# view 
if args.v:
    mesh.update_polydata()
    mesh.update_normals()
    mesh.display()