Integration of 2D and 3D nanostructure fabrication with wafer