import torch


def __normalize_vertices(vertices):
    """
    Normalizes vertices to fit an [-1...1] bounding box,
    common during training, but not necessary for visualization.
    """
    result = vertices - torch.mean(vertices, dim=0).unsqueeze(0)
    span = torch.max(result, dim=0).values - torch.min(result, dim=0).values
    return result / torch.max(span)