Electromagnetic wavefront portions grazing or nearly grazing the surface of a macroscopic particle contribute to the extinction of the incident radiation through a tunneling process similar to the scenario of barrier penetration in quantum mechanics. The aforesaid tunneling contribution, referred to as the edge effect, is critical to a correct depiction of the physical mechanism of electromagnetic extinction. Although an analytical solution for the edge effect in the case of a sphere has been reported in the literature, the counterparts for nonspherical particles remain unknown. The conventional curvature-based formalism of the edge effect breaks down in the case of faceted particles. This paper reports a method, based on the invariant imbedding principle and the Debye expansion technique, to accurately quantify the edge effect associated with an arbitrarily shaped three-dimensional object. The present method also provides a rigorous capability to facilitate the validation of various empirical approximations for electromagnetic extinction. Canonical results are presented to illustrate optical tunneling for two nonspherical geometries.