def getBoundingBox(veclist):
    """Calculate bounding box (pair of vectors with minimum and maximum
    coordinates).

    >>> getBoundingBox([(0,0,0), (1,1,2), (0.5,0.5,0.5)])
    ((0, 0, 0), (1, 1, 2))"""
    if not veclist:
        # assume 3 dimensions if veclist is empty
        return (0,0,0), (0,0,0)

    # find bounding box
    dim = len(veclist[0])
    return (
        tuple((min(vec[i] for vec in veclist) for i in range(dim))),
        tuple((max(vec[i] for vec in veclist) for i in range(dim))))