1. Apparatus for mapping an object, comprising: an illumination assembly, comprising: a transparency containing a plurality of micro-lenses arranged in a non-uniform pattern; a light source, which is configured to transilluminate the transparency with optical radiation, wherein the micro-lenses are configured to focus the optical radiation to form, at a focal plane, respective focal spots in the non-uniform pattern; and optics configured to project the non-uniform pattern of the focal spots from the focal plane onto the object; an image capture assembly, which is configured to capture an image of the pattern that is projected onto the object using the transparency; and a processor, which is coupled to process the image captured by the image capture assembly so as to reconstruct a three-dimensional (3D) map of the object, wherein the processor is arranged to derive the 3D map by finding respective offsets between the pattern of the spots on multiple areas of the object captured in the image of the pattern that is projected onto the object and another image of the pattern, wherein the respective offsets are indicative of respective distances between the areas and the image capture assembly.