Creating Line Geometry Vertices with Breaks

Thank you all very much for the help!
I finally could solve this:
https://www.koulaouzidis.com/ars-combinatoria/research/1394-on-xyz.threejs_v1.7.html

Follow-up Question:
Can LineSegment also give a certain part of the line another color?