difference between two spheres

Hi all,
I want to make the difference of two spheres. I just create them and the difference of them I want to highlight with another color. The problem is that althought I get the points of the intersecting spheres I do not get the desired result. Has anyone a piece of code to help me with this? I am not sure wether the problem is in math, I have done what I think was correct…

Post your code and we’ll have a look.