I am trying to detect when a closed parametric surface intersect itself. My surface is described as a triplet of parametric functions $x(u,v)$, $y(u,v)$ and $z(u,v)$ where $u,v\in[0,1]$. For that purpose I'm trying to use the Gauss-Bonnet theorem. This theorem relates the integral of the Gaussian curvature over the surface to the Euler characteristic (which is an invariant of a regular surface).
My questions is the following: will the Euler characteristic computed by the Gauss-Bonnet theorem change if the surface self-intersects, and if so, in what manner?
Thanks