Here is another approach.
No NaN
s, no shaders. Just THREE.LineSegments()
with a single indexed THREE.BufferGeometry()
:
https://jsfiddle.net/prisoner849/1j131tnt/
For the reference:
https://threejs.org/examples/?q=line#webgl_buffergeometry_lines_indexed