예제 #1
0
def rectangle_pairs():
    random.seed(0)
    simple = simple_rectangles()
    randomized = [rectangle(-256, 256, -256, 256) for _ in range(250)]
    randomized = [
        lab.Rectangle(x, y, w, h) for (x, y, w, h) in randomized
        if w > 0 and h > 0
    ]
    return list(iter_pairs(simple)) + list(iter_pairs(randomized))
예제 #2
0
def simple_rectangles():
    return [lab.Rectangle(0, 0, 128, 128),
            lab.Rectangle(-128, -128, 128, 128),
            lab.Rectangle(-64, -64, 128, 128)]