Code from article "Real Time Constructive Solid Geometry" in the book "Game Development Tools"