def brensenham_line(x, y, x2, y2):
    coords = []
    dx = abs(x2 - x)
    dy = abs(y2 - y)
    d = (2 * dx) - dy
    for i in range(0, dy):
        coords.append((x, y))
        while d >= 0:
            x -= 1
            d -= (2 * dy)
        y += 1
        d += (2 * dx)
    coords.append((x2,y2))
    return coords
Modified to draw hex sides in HexCheckImage.
dataset/ETHPy150Open ardekantur/pyglet/contrib/scene2d/scene2d/debug.py/brensenham_line