A general approach to the optimal synthesis of Shaped-Beams through fixed geometry arrays