Generation of projection patterns with a minimal intensity gradients. This technique can be employed with an arbitrary number of frames and grey-levels. The problem of "minimizing the intensity gradients" is transferred to "finding the shortest route through code-space". The equivalent problem is solved using a “Travelling Salesman Problem” solver. Technique improves Color-coding techniques by optimizing the 3D color-space. Less measurement planes are required than sinusoidal SLI without losing accuracy.