Extending GCodeLoader to use Fat Lines

I’m new to three.js and trying to wrap my head around why my implementation of the gcode loader example doesn’t quite work right when I convert it over to use LineSegments2. I added the reference to LineSegments2 and changed the one line in the parser to use LineSegments2 instead of LineSegments and updated the material to use LineMaterial with a linewidth of 5 instead of LineBasicMaterial. This is what comes out.

You’ll notice all the green lines disappear, the red lines are still using the original material LineBasicMaterial. Any help with this would be greatly appreciated. My changes can be seen at the link below.

When using wide lines, you also need to work with special geometry classes like LineGeometry or LineSegmentsGeometry. Right now, you just pass in an ordinary BufferGeometry which does not work.

It’s best to closely study the official example to see how these geometry classes are used.



Thanks for the pointer @Mugen87. Looks like converting to LineSegmentsGeometry is getting me somewhere, albeit at a huge performance hit with unexpected results. The entire scene goes green and the browser becomes completely unresponsive.I think maybe this isn’t going to work for my use case and there’s too much geometry to process? The example benchy.gocde file is fairly small, so with larger files this is going to get even worse. Maybe if the gcode parser only retrieves the external perimeter lines and draws those it might work.