Nanoimprinting over topography and multilayer three-dimensional printing