GCode loader with different material


Could anyone help me with amending the GCodeLoader please? The problem is that I want to hide the travel lines (the red lines in benchy.gcode example). I managed to do this in the gcodeloader.js, but the remaining green lines make it overall a very hard to see the object. It is hard to see any depth or shadows because the LineBasicMaterial does not support this (or does it?)

I think it could be a solution to change the LineBasicMaterial to some sort of MeshBasicMaterial, but I can’t figure out how…


You can’t render line primitives with mesh or point cloud materials. However, you can try to use the wide line implementation of three.js.

In this way, the geometry data are rendered as mesh lines (sometimes called ribbons) which it possible to configure a line width > 1. This makes it possible to easier see lines.

Thank you, I’ll give this a try!

Hi Mugen87 / community,

I’ve been playing and trying the suggested solution in this topic to use LineGeometry implementation as used in the wide lines example with Line2 and LineMaterial in the GCodeLoader. However, this doesn’t work. I also found that someone else tried to do the same (Link), but this user is running into the same issues: browser gets unresponsive by possibly an overload of data without using a complex model (even benchy.gcode is not working). Is there any other way to get lines that are susceptible by light?