def clean_mesh(mesh):
    """This function cleans up the mesh for decimating the mesh.
    
    Returns
    -------
    mesh : trimesh.base.Trimesh
        A mesh that has been "cleaned" so that it can be manipulated for LODS
    """

    mesh.remove_degenerate_faces()
    mesh.remove_duplicate_faces()
    mesh.remove_unreferenced_vertices()
    mesh.remove_infinite_values()
    mesh.fill_holes()

    return mesh