grid.py
def draw_edge(arr, v1, v2, dim, shade = 1):
    """
    Detects and replaces entries in array 'arr' that are pieced by the
    segment (v1, v2) with the quantity 'shade'. 'dim' is used to
    determine how finely to search for pieced entries.

    Used in draw_shapes method.
    """
    v1, v2 = np.array(v1), np.array(v2)
    for i in np.linspace(0, 1, num = max(dim)):
        u = v1 + i*(v2-v1)
        if u[0]<0 or u[1]<0 or u[0]>dim[0]-1 or u[1]>dim[1]-1:
            continue
        if all([d > 200 for d in dim]):
            arr[round(u[0]), int(math.ceil(u[1]))] = shade
            arr[round(u[0]), int(math.floor(u[1]))] = shade
        else:
            arr[round(u[0]), round(u[1])] = shade
    return arr

    Detects and replaces entries in array 'arr' that are pieced by the
    segment (v1, v2) with the quantity 'shade'. 'dim' is used to
    determine how finely to search for pieced entries.

    Used in draw_shapes method.
    
Detects and replaces entries in array 'arr' that are pieced by the
segment (v1, v2) with the quantity 'shade'. 'dim' is used to
determine how finely to search for pieced entries.

Used in draw_shapes method.
Detects and replaces entries in array ' arr ' that are pieced by the segment ( v1 v2 ) with the quantity ' shade ' . ' dim ' is used to determine how finely to search for pieced entries . Used in draw_shapes method .
def draw_edge(arr, v1, v2, dim, shade = 1):
    v1, v2 = np.array(v1), np.array(v2)
    for i in np.linspace(0, 1, num = max(dim)):
        u = v1 + i*(v2-v1)
        if u[0]<0 or u[1]<0 or u[0]>dim[0]-1 or u[1]>dim[1]-1:
            continue
        if all([d > 200 for d in dim]):
            arr[round(u[0]), int(math.ceil(u[1]))] = shade
            arr[round(u[0]), int(math.floor(u[1]))] = shade
        else:
            arr[round(u[0]), round(u[1])] = shade
    return arr
def draw_edge ( arr , v1 , v2 , dim , shade = 1 ) : v1 , v2 = np . array ( v1 ) , np . array ( v2 ) for i in np . linspace ( 0 , 1 , num = max ( dim ) ) : u = v1 + i * ( v2 - v1 ) if u [ 0 ] < 0 or u [ 1 ] < 0 or u [ 0 ] > dim [ 0 ] - 1 or u [ 1 ] > dim [ 1 ] - 1 : continue if all ( [ d > 200 for d in dim ] ) : arr [ round ( u [ 0 ] ) , int ( math . ceil ( u [ 1 ] ) ) ] = shade arr [ round ( u [ 0 ] ) , int ( math . floor ( u [ 1 ] ) ) ] = shade else : arr [ round ( u [ 0 ] ) , round ( u [ 1 ] ) ] = shade return arr
Detects and replaces entries in array 'arr' that are pieced by the
segment (v1, v2) with the quantity 'shade'.
Detects and replaces entries in array ' arr ' that are pieced by the segment ( v1 v2 ) with the quantity ' shade ' .
"""
    Detects and replaces entries in array 'arr' that are pieced by the
    segment (v1, v2) with the quantity 'shade'. 'dim' is used to
    determine how finely to search for pieced entries.

    Used in draw_shapes method.
    """
arr
v1
v2
dim
shade