Broken 3D model

Ok guys @ XAR actually wrote the code for this using the “storing the normal vector of the surface at the intersection” unfortunately is not usable some markers are acceptable but others do now work, can this be improved?

https://webdesign-flash.ro/ht/emv/