Need optics with shallow depth of field for distance measurement

I need to make non-contact measurements by moving a sample on a precision stage and using some optical device for reference. Is there any optical system that I can buy or assemble easily that has a very shallow depth of focus, ideally about 0.1mm? And a working distance (i.e. distance between the front-most lens and the focus) at least 40mm. I thought about microscopes, but I understand they are optimized for large depth of field.

The best I’ve come up with so far is a DSLR with a macro lens - I have access to a Nikon 105mm F/2.8. But this lens has an effective focal ratio of only F/4.8 when it’s at 1:1 magnification, which is a bit slow.

Any other ideas?

You want the objective to have a large diameter, so that the rays from the object come to the edges of the objective at very different angles.

You can make a distance measuring device with a huge effective diameter in this sense by using mirrors to bounce one of the optical paths twice, like in a periscope. Seen from the object looking toward the optical system, it then has two separate chunks of aperture that are widely separated. There are already optical systems built like this for distance measurement; typically when they are out of focus they appear to have two ghostly images that are offset, and focusing the device brings the two images together.

If you’re looking for short depth of focus lenses for distance measurement, try microscope objectives – that’s what we used at one of my former businesses. You can get highly corrected, small f/# (large aperture) verty short depth of focus lenses from plavces like Nikon and Mitutoyo.