But this doesn't work when a surface is curved like a ball. You triangulate these projections of the vertices on x-y plane, but some obtained triangles are not the projections of the real triangles on the surface.

Ilya and Jan, because of floating point arithmetic, it's impossible to find intersections perfectly in all cases. Jan, your example has two curves that touch at a single point; some people might define this as an intersection. Your assertion that (0,0) isn't an intersection is debatable.

Comment only