Hi, since your oibjective is to split all existing lines, its sufficient to:
- Get coordinates of the midpoints in all existing lines.
- Add the midpoints to your original points and you have the new points array
- Create two lines from each of the original lines, using the new midpoints.