Ray Engineering from Chaos to Order in 2D Optical Cavities