High accuracy contouring using grating projection