A theoretical model and a computational algorithm are presented for the shadow deposition of thin films through a generalized mask of finite dimensions in a vacuum environment. The computer model enables a theoretical study of the deposited-film-thickness profile from extended sources with shadow effect. Numerical evaluation of the masked deposition profile has been carried out to illustrate the film-profile dependences on several basic mask parameters. Using computer-aided design procedures, a deposition mask has been successfully constructed for the fabrication of precisely shaped thin-film Luneburg lenses for guided-optical-wave applications.