1. A scanner for obtaining and/or measuring a 3D geometry of at least a part of a surface of an object, said scanner comprising: a first light source configured for generating probe light rays; a first camera comprising an array of sensor elements, where said first camera is configured for obtaining at least one image from said array of sensor elements; an arrangement of optical components configured for: transmitting the probe light rays towards the object such that at least a part of the object can be illuminated; transmitting light rays returned from the object to the array of sensor elements; and imaging with a first depth of field at least part of the transmitted light rays returned from the object onto the array of sensor elements; where the arrangement of optical components comprises focusing optics that define a focus plane for the scanner, and where at least part of the optical components forms a first optical system that provides the imaging of light onto the array of sensor elements; a positioning device configured for varying the position of the focusing optics, such that the position of the focus plane relative to the scanner is changed; a second camera arranged to capture a portion of the light rays returned from the object, where the light rays have been transmitted through at least a part of the first optical system, to provide a second depth of field image with a second depth of field, where the second camera is arranged in the aperture in the first optical system; a data processing device, configured for: determining the in-focus position(s) of: each of a plurality of the sensor elements for a range of focus plane positions, or each of a plurality of groups of the sensor elements for a range of focus plane positions, and for transforming the in-focus data into 3D coordinates; where a ratio between the second depth of field and the first depth of field is in the range of 10 to 2000, and a region of the aperture, where the light rays are captured from by the second camera, is less than 30% of an area of the aperture.