Described herein are apparatuses and methods for confocal 3D scanning. The apparatus can comprise a spatial pattern disposed on a transparent base and a light source configured to provide illumination to the spatial pattern and an optical system comprising projection/imaging optics having one or more lenses and an optical axis. The projecting/imaging optics may be scanned to provide depth scanning by moving along the optical axis.