THREE.Line2: TypeError: value is undefined / setIndex

When Im adding more than one line with THREE.Line2 I am running into an Error on rendering (on CentOS, working on Windows).

TypeError: value is undefined

image

Im using the same code as I did before to create the THREE.Line.

        const geometry = new LineGeometry();
    geometry.setPositions( positions );		
    const lineMaterial = new LineMaterial( { color: 0xffffff } );
	
    const line = new Line2( geometry, lineMaterial );
1 Like

Can you please reproduce the problem with a live example?

If you provide a fiddle, I can make a test on Ubuntu.

BTW: Does the official example work on your machine?

https://threejs.org/examples/#webgl_lines_fat

The fat lines example does work.
Here is a fiddle Ive built on windows, I verify tomorrow if ist working on CentOS: https://jsfiddle.net/ogLq49rw/

Your fiddle works on my Ubuntu 16.04 LTS with Chromium 66.0.3359.139.

Everything is working without Errors on my machines too, includiing my current project in development. Which was the reason I asked this question in the first place, although I didnt change related code (AFAIR).

It seems like I cant reliable reproduce the Error, but it occured for some weeks, even on Windows sometimes.

Small update
Ive stumbled upon this Error in my project again, and randomly discovered a Workaround by just creating a new BufferGeometry anywhere:
new THREE.BufferGeometry();

Adding this line anywhere in my Code prevents the Error from Happening.
I couldnt figure out whats the reason behind this, but for now I am OK going that way. If this is enough evidence for you to guess wheres the root of this Problem please let me know.

In my case everything was working fine.But when i need to add box2djs(didnt used any part of it, just inserted in html) file in project. After that, “value is undefined at line16343” starts coming. Ran simple threejs tutorial code with having box2d script in html , works fine. Then at this link, it says to change geometry to buffergeometry, which then worked for me.
P.S: I was using different materials for different faces.