print("Switched to Linear Blend Skinning")
    elif key == ord(' '):
        if animation:
            viewer.core.is_animating = False
            animation = False
        else:
            viewer.core.is_animating = True
            animation = True
    return False


if __name__ == "__main__":
    keys = {"d": "toggle between LBS and DQS",
            "space": "toggle animation"}

    print_usage(keys)

    V = igl.eigen.MatrixXd()
    F = igl.eigen.MatrixXi()
    C = igl.eigen.MatrixXd()
    BE = igl.eigen.MatrixXi()
    P = igl.eigen.MatrixXi()
    W = igl.eigen.MatrixXd()
    M = igl.eigen.MatrixXd()

    sea_green = igl.eigen.MatrixXd([[70. / 255., 252. / 255., 167. / 255.]])

    anim_t = 0.0
    anim_t_dir = 0.015
    use_dqs = False
    recompute = True
Esempio n. 2
0

# Define a rigid motion
def transform(t):
    T = igl.eigen.Affine3d()
    T.setIdentity()
    T.rotate(t * 2 * pi, igl.eigen.MatrixXd([0, 1, 0]))
    T.translate(igl.eigen.MatrixXd([0, 0.125 * cos(2 * pi * t), 0]))
    return T


if __name__ == "__main__":
    keys = {
        "space": "toggle between transforming original mesh and swept volume"
    }
    print_usage(keys)

    V = igl.eigen.MatrixXd()
    SV = igl.eigen.MatrixXd()
    VT = igl.eigen.MatrixXd()
    F = igl.eigen.MatrixXi()
    SF = igl.eigen.MatrixXi()
    show_swept_volume = False
    grid_size = 50
    time_steps = 200
    isolevel = 1

    igl.read_triangle_mesh(TUTORIAL_SHARED_PATH + "bunny.off", V, F)

    print("Computing swept volume...")
    igl.copyleft.swept_volume(V, F, transform, time_steps, grid_size, isolevel,