def printColorAsPly(mesh,distanceList,name,if3 = True): col = dist2color2(distanceList) nv,nf = mesh.returnVF() if if3 == True: col = color2color_x_3(col) nv,nf = divide_face(mesh) mut.save_ply_file_color(name,nv,nf,col)
def printColorAsPly(mesh, distanceList, name, if3=True): col = dist2color2(distanceList) nv, nf = mesh.returnVF() if if3 == True: col = color2color_x_3(col) nv, nf = divide_face(mesh) mut.save_ply_file_color(name, nv, nf, col)
def test6(): vi = md.readvisible("./data/visible/visibleFace0319.txt") m = m3d.model3d_changeLo() m.read_ply("./data/reduction_data/mrvert/rdmove0319-vert.ply") v, f = md.divide_face(m) c = md.showVisibleAsColor(vi) c2 = md.color2color_x_3(c) print v.shape mut.save_ply_file_color("visibleCheck.ply", v, f, c2) return 0
def printColorAsPLY_xyz(mesh, distancelist, dir): nv, nf = divide_face(mesh) c, c2 = distancelist2colorlist(distancelist) for x in xrange(3): faceclors = c2[x] if os.path.exists(dir) == False: os.mkdir(dir) outdir = "./" + dir + "/" + "distDataface%02d/" % x if os.path.exists(outdir) == False: os.mkdir(outdir) xyz = ["x", "y", "z"] for y in xrange(3): faceColorxyz = faceclors[y] name = outdir + xyz[y] + "dist_color_f%02d" % x + ".ply" print "save",name mut.save_ply_file_color(name, nv, nf, faceColorxyz)
def printColorAsPLY_xyz(mesh, distancelist, dir): nv, nf = divide_face(mesh) c, c2 = distancelist2colorlist(distancelist) for x in xrange(3): faceclors = c2[x] if os.path.exists(dir) == False: os.mkdir(dir) outdir = "./" + dir + "/" + "distDataface%02d/" % x if os.path.exists(outdir) == False: os.mkdir(outdir) xyz = ["x", "y", "z"] for y in xrange(3): faceColorxyz = faceclors[y] name = outdir + xyz[y] + "dist_color_f%02d" % x + ".ply" print "save", name mut.save_ply_file_color(name, nv, nf, faceColorxyz)
def saveResultPCA(outdir, applyMeshName, c_ratio_all, evr_all): m = m3d.model3d_changeLo() m.read_ply(applyMeshName) nv, nf = md.divide_face(m) dir_r = outdir + "colorPly/c_ratio" dir_e = outdir + "colorPly/c_evr" mut.mkdir_p(dir_r) mut.mkdir_p(dir_e) for i in xrange(comp_max - 1): md.set_scale(0, 1) col = md.dist2color2(c_ratio_all[:, i]) col3 = md.color2color_x_3(col) mut.save_ply_file_color(dir_r + "/" + "ratio_c%03dframe0000.ply" % i, nv, nf, col3) col = md.dist2color2(evr_all[:, i]) col3 = md.color2color_x_3(col) mut.save_ply_file_color(dir_e + "/" + "evr_c%03dframe0000.ply" % i, nv, nf, col3)