From Ewald sphere to Ewald shell in nonlinear optics