You can try with three-mesh-bvh, you can cast the ray along any axis you need.
Here’s an excellent implementation: