def makebb(pnts):
    """
    Find the bounding box for a list of points.

    Arguments:
        pnts: Sequence of 2-tuples or 3-tuples

    Returns:
        A list [minx, maxx, miny, maxy[, minz, maxz]].
    """
    x = [p[0] for p in pnts]
    y = [p[1] for p in pnts]
    rv = [min(x), max(x), min(y), max(y)]
    if len(pnts[0]) == 3:
        z = [p[2] for p in pnts]
        rv += [min(z), max(z)]
    return rv