コード例 #1
0
def calc_f2f_distance_in_localcoord_onlyVisible(mesh1,mesh2,visibleList):
    f2 = mesh2.faces
    v2 = mesh2.vertexes
    f1 = mesh1.faces
    v1 = mesh1.vertexes

    row, col = f2.shape

    distList = []

    for s in xrange(col):
        dist = mut.change_local(v2[:, f2[:, s]],mesh1.solves[s]) - mut.change_local(v1[:, f1[:, s]],mesh1.solves[s])
        distList.append(dist)

    """
    データ構造解説
    dist = ([d0x,d1x,d2x]
            [d0y,d1y,d2y]
            [d0z,d1z,d2z])

    distList = dist0,dist1,dist2...distN

    """

    return distList
コード例 #2
0
def restoreGlobal(solve,distance):
    invsolve = np.linalg.inv(solve)
    init = np.array([[0, 0, 0],
                    [0, 0, 0],
                    [0, 0, 0]])
    dist = mut.change_local(distance,invsolve) - mut.change_local(init,invsolve)

    return dist
コード例 #3
0
def calc_one_frame(model1,model2):

    dist_list = md.calc_f2f_distance(model1, model2)

    frame_dist = []
    frame_dist_r = []
    for f in xrange(len(dist_list)):
        dist = mut.change_local(dist_list[f],model1.solves[f])
        frame_dist.append(dist)
        dist_r = rearrange_dist(dist)
        frame_dist_r.append(dist_r)

    return frame_dist,frame_dist_r