I just came across a lengthy discussion on the PrintNC discord channel where a user is combining a webcam sensor without a lens and a laser level to accurately measure the variation in the surface of a steel beam that he's using in the construction of his CNC.
You can see a video explaining what he's doing here on his channel; https://www.youtube.com/watch?v=hnHjrz_inQU
And find the discussion of this method here; https://discordapp.com/channels/648972213734604807/1078447519517921392
And the webcam software can be found here; https://github.com/betzuka/laserlevel
This is all very intriguing to me, as I've built a CNC and I'd love to improve it's precision. And this should help, but I immediately wondered if these sensors could be combined with mesh bed levelling, to provide a highly accurate CNC, without the added steps of modifying the CNC gantry. Couldn't a CNC (or 3D printer) simply substitute a sensor like Duet's IR sensor for this webcam / laser level combo, run along the X and Y axis, while measuring the deviation, and then compensate?
Further; and this gets into even more intriguing territory for CNC's; couldn't the controller also measure deflection of the gantry in real time, along with a tool height sensor, to determine (and compensate for) spring forces?