Welcome the traditional way! That image is beautiful.
I've looked briefly at your code, but can't give a qualified comment on the
math. I can only say, that in order to get seamless CSG it needs to be
flawless (and that's why I would've tried with blobs).
See you soon again,
Hugo