This paper describes a new technique that was developed for performing three-dimensional (3-D) reconstruction on-the-fly for inspection applications. It is based on the same principles as the traditional depth from focus approach but is able to estimate the three-dimensional structure of a surface as it is undergoing a continuous linear lateral translation, similar to the situation on many types of modern production lines. This has important applications in the area of automated inspection and quality control, since the ability to inspect materials in real-time as they are being manufactured in a continuous process is valuable in a broad range of circumstances. We assume that the relative motion of the surface is known, which is realistic in these types of environments. We demonstrate the technical feasibility of our approach, including its ability to acquire 3-D shape on several different types of structured surfaces.