def METHOD_NAME(boxes, horizontal):
    if len(boxes) == 0: return
    constraints = []
    curr = boxes[0]
    for box in boxes[1:]:
        if horizontal:
            constraints.append(curr.right + FloorPlan.MARGIN <= box.left)
        else:
            constraints.append(curr.top + FloorPlan.MARGIN <= box.bottom)
        curr = box
    return constraints