def scale_mesh(mesh, scale):
    """ This function scales the vertices to range from 0 to scale 
    
    Parameters
    ----------
    mesh : trimesh.base.Trimesh
        A Trimesh mesh object to scale
    scale : int
        Specifies the max for the new range
    
    Returns
    -------
    scaled_mesh : trimesh.base.Trimesh
        Trimesh mesh object whose vertices ranges from 0 to scale
    """

    vertices = mesh.vertices
    maxval = vertices.max(axis=0)
    minval = vertices.min(axis=0)

    max_nodes = scale/(maxval-minval)
    verts_scaled = max_nodes*(vertices - minval)
    scaled_mesh = mesh.copy()
    scaled_mesh.vertices = verts_scaled

    return scaled_mesh