How to achieve light and shadow after gcode data

Before the model line segment is thickened

Model after how to achieve the effect of light and shadow, whether we can provide effective help thank you, I use LineMaterial and LineGeometry to achieve gcode data segment bold, now is the effect of light and shadow can not be achieved.

Line materials do not support lights and shadows.

Consider to represent a thick line as a tube mesh.

Changing to a pipe network causes performance consumption and increased data

Implementing lights for lines (and points) is conceptually difficult because according to a strict interpretation they have no normals.

Is it possible that we create normals artificially

i don’t think shadows would make much of a difference here even if it did work and had normals tbh, it’s not going to creep into the crevices like that. I would try SSAO, using that to differentiate shapes can work much better than shadows. only have a react example sorry but you can port it: react-three-fiber line2 raycasting - CodeSandbox this is using GitHub - vanruesc/postprocessing: A post processing library that provides the means to implement image filter effects for three.js. you can tweak it to make it less noisy.

I used LineGeometry and LineMaterial to render the gcode model in the figure, mainly made some adjustments, remove the travel line, and made some modifications to the GCodeLoader.js algorithm