Y position at a certain x position of a moving tubegeomerty

You should not constantly create new objects in animate.

new THREE.Raycaster()
(new THREE.Vector3(x, 0, 0), new THREE.Vector3(0, 1, 0))

You can create them once and then use them.

Take a look at the beginner example step 10 from the collection.

see also
RaycastingToLine
RaycasterAfterUpdatingPositions