The title is what it says it. Float32Array[] works like number[][], probably because both are still arrays after all, with usual index stuff and length props.
Why would this be useful? I dont know. Kimi K2.6 Instant High actually suggested this in a response:
For CreateGreasedLine’s points parameter, yes — if you want multiple disconnected lines in one mesh, number[][] or Vector3[][] are the documented formats. There’s no “indexed” mode (single flat buffer + break indices).
But you have alternatives:
-
Float32Array[]— likely works in place ofnumber[][]and avoids boxed numbers. Much less GC pressure. -
instanceparameter — build oneGreasedLineMeshincrementally:
const master = CreateGreasedLine("synapses", { points: firstBatch }, { width: 0.02 }, scene);
CreateGreasedLine(null, { points: secondBatch, instance: master }, { width: 0.02 });
Still needs [][] per batch, but you don’t create new mesh objects.
-
Raw vertex data —
GreasedLineMeshis just a mesh. You can access its vertex buffers viamesh.getVerticesData()/updateVerticesData()and push line segments directly. Bypasses thepointsAPI entirely, but you need to understand its internal vertex layout (position + width + color interleaved). -
Single continuous line with zero-width segments — pass one flat
number[]and set width to 0 for the “jump” segments. Hacky, but avoids[][].
For your scale (potentially millions of synapses), option 2 with pooled Float32Array inner arrays is the pragmatic middle ground. Option 3 is the nuclear option if profiling shows CreateGreasedLine itself is the bottleneck.
What does your new test code layout look like? I can write newSynapseBatch to match whatever fts shape you settle on.