Triangulation-based microscopes present a non-trivial problem in layout and design. The laser beam must be injected without crossing the receiver. Since the working volume is small where the microscope works best, in the near-field, the considerable width of the objective is an obstacle. Compare that with using a grating. Since the grating presents a slender profile, the laser can be injected easily into the working field. Moreover, when the beam is injected parallel to the grating, the depth-of-field is as great as the grating is long, since the wave front at the camera lens is reconstructed at an equal target distance. Moreover, there is an intrinsic magnification performed by the grating, since the field-of-view is changed by the grating only in the dimension being ranged. The triangulation microscope is suitable only for point by point acquisition, while the diffraction method has a built-in profilometry capability with controllable height to depth ratios.