Currently facing a challenge with three.js as I attempt to accomplish a specific task. Unsure if I should start from scratch or stick with my current approach.
I am working on parsing a gcode file, essentially a large text file containing position and extrusion data for 3D printers. I am reading through it sequentially, loading all positions into THREE.Geometry()
as vertices, and creating a line using these positions along with vertex colors.
This is the code snippet:
// Code snippet here
I have identified which pairs of vertices need to be invisible based on a flag in geometryArr
. Now, I need to address them accordingly.
Attempts made so far: * Removing the relevant vertice pairs results in the line being drawn between the subsequent set of vertices. * Adding a second line with transparent (0 opacity) segments where needed did not yield desired outcomes. * Rendering each line segment individually caused severe performance issues due to the high number of line segments involved.
Wondering if THREE.Geometry
and THREE.Line
offer any functionality to remove specific line segments?
It seems that if not available, I might have to transfer this process to THREE.BufferGeometry
and utilize shaders to render certain lines as invisible. A more time-consuming solution that I hoped to avoid.
Your assistance is greatly appreciated!