Fixed bug with CSG: initial position of ray (inside/outside) was not taken into account
Minor refactoring