A bit of context, I’m trying to rewrite a loader that creates a bunch (10k-60k) of three geometries representing lines in 3d space with differing numbers of points making up with each line. The lines are not expected to be connected. Initially, each geometry is then used to create a separate THREE.Line.
This works and things look like I expect, however the performance is subpar.
My approach to optimization thus far has been to create a single BufferGeometry using position instead of vertices and then to render the whole geometry with a THREE.LineSegments object. However, it seems like LineSegments makes the assumption that each line is made up of 2 3d points and breaks up the lines accordingly. If I use a Line object instead, it appears to connect all of the disconnected lines, which makes sense but isn’t what I’m looking for ultimately. I tried some experiments with BufferGeometry indicies but feels like I may be going in the wrong direction with that.
So my question is: what is a performant way to build up a BufferGeometry for and render many disconnected lines each made up of a different number of points?
Created a small live code demo of what I’m attempting here: https://jsfiddle.net/xpqL8o6b/15/