How does this model get the position where the ray hits and modify the color of the face adjacent to it?

Hello, please modify the click position and change the color of the stick with it.
live example