def gridPointsFromEdges(edges, nCells, dtype=float):
e = edges<EOL>sx, sy = nCells[<NUM_LIT:0>] + <NUM_LIT:1>, nCells[<NUM_LIT:1>] + <NUM_LIT:1><EOL>x0 = np.linspace(e[<NUM_LIT:0>, <NUM_LIT:0>], e[<NUM_LIT:3>, <NUM_LIT:0>], sy, dtype=dtype)<EOL>x1 = np.linspace(e[<NUM_LIT:1>, <NUM_LIT:0>], e[<NUM_LIT:2>, <NUM_LIT:0>], sy, dtype=dtype)<EOL>y0 = np.linspace(e[<NUM_LIT:0>, <NUM_LIT:1>], e[<NUM_LIT:3>, <NUM_LIT:1>], sy, dtype=dtype)<EOL>y1 = np.linspace(e[<NUM_LIT:1>, <NUM_LIT:1>], e[<NUM_LIT:2>, <NUM_LIT:1>], sy, dtype=dtype)<EOL>p = np.empty(shape=(sx * sy, <NUM_LIT:2>))<EOL>n0 = <NUM_LIT:0><EOL>n1 = sx<EOL>for x0i, x1i, y0i, y1i in zip(x0, x1, y0, y1):<EOL><INDENT>p[n0:n1, <NUM_LIT:0>] = np.linspace(x0i, x1i, sx)<EOL>p[n0:n1, <NUM_LIT:1>] = np.linspace(y0i, y1i, sx)<EOL>n0 = n1<EOL>n1 += sx<EOL><DEDENT>return p<EOL>
creates a regular 2d grid from given edge points (4*(x0,y0))
and number of cells in x and y

returns horizontal and vertical lines as (x0,y0,x1,y1)