def apply_rot()

in contactopt/util.py [0:0]


def apply_rot(rot, verts, around_centroid=False):
    """
    Applies a 3x3 rotation matrix to a list of points
    :param rot: tensor (batch, 3, 3)
    :param verts: tensor (batch, N, 3)
    :return:
    """
    if around_centroid:
        centroid = verts.mean(dim=1)
        verts = verts - centroid

    new_verts = torch.bmm(rot, verts.permute(0, 2, 1)).permute(0, 2, 1)

    if around_centroid:
        new_verts = new_verts + centroid

    return new_verts