Open HowardACornwell opened 5 years ago
@HowardACornwell I had this issue this week. In case you're still stuck, it was because I was using the three-full npm package, which provides Typescript support to three.js.
My THREE.Geometry
was using the three-full
namespace instead of the three.js namespace, so in the source code for line.setGeometry(g)
, the following line failed (which is where the positions get added):
if (g instanceof THREE.Geometry) {
.....
}
I realised then that three.js provides it's own Typescript support, so I removed three-full
from my project and modified it to use the three.js type definitions instead. Everything worked fine then.
P.S This would also explain why your code works using Float32Array
, since the positions are added in a different code block, where the condition is:
if (g instanceof Float32Array || g instanceof Array) {
......
}
which is true in your case.
Passing a
THREE.Geometry
toMeshLine.setGeometry()
is not working.MeshLine.positions
is empty, andMeshLine.next
and.previous
are[undefined, ...]
.Versions are Three.js 102 and MeshLine 1.2
Using a Float32Array works.