def recenter(positions):
    (x0, y0, z0), (x1, y1, z1) = bounding_box(positions)
    dx = x1 - (x1 - x0) / 2.0
    dy = y1 - (y1 - y0) / 2.0
    dz = z1 - (z1 - z0) / 2.0
    result = []
    for x, y, z in positions:
        result.append((x - dx, y - dy, z - dz))
    return result
Link to an external page with caption.
dataset/ETHPy150Open fogleman/pg/pg/util.py/recenter--crossover with--dataset/ETHPy150Open mozilla/kitsune/kitsune/sumo/tests/test_parser.py/TestWikiImageTags.test_link_caption