We solve the problem of two-dimensional flow of a viscous fluid over a rectangular approximation of an etched hole. In the absence of inertia, the problem is solved by a technique involving the matching of biorthogonal infinite eigenfunction expansions in different parts of the domain. Truncated versions of these series are used to compute a finite number of unknown coefficients. In this way, the stream function and its derivatives can be determined in any arbitrary point. The accuracy of the results and the influence of the singularities at the mask-edge corners is discussed. The singularities result in a reduced convergence of the eigenfunction expansions on the interfaces of the different regions. However, accurate results can be computed for the interior points without using a lot of computational time and memory. These results can be used as a benchmark for other methods which will have to be used for geometries involving curved boundaries. The effect of hole size on the flow pattern is also discussed. These flow patterns have a strong influence on the etch rate in the different regions.