Formation of mesoscopic polymer structures for optical devices by