Programmable nanoengineering templates for fabrication of three-dimensional nanophotonic structures