LDraw-like edges

I took a crack at it too to see how it looked with more complex and smoother geometry – there are a few weird cases but it looks pretty good. This is using EdgesGeometry to render hard edges along with the conditional lines:

Here’s the live demo:

https://gkjohnson.github.io/threejs-sandbox/conditional-lines/

For collapsing a hidden edge I originally tried setting gl_Position to vec4( 0.0, 0.0, 0.0, 1.0 ) but saw some weird artifacts for some reason. I wound up just setting the position to the control point 0 vector in order to collapse the line – using the direction seems good, too. It work well enough on the two machines I tried it on, at least. I’m not sure why setting the position to 0.0 results in artifacts, though :confused:

17 Likes