speckle-server icon indicating copy to clipboard operation
speckle-server copied to clipboard

Viewer: Emulate lines with triangles

Open AlexandruPopovici opened this issue 2 years ago • 1 comments

In order to be able to unniversally control lineWidth (lineweight) in th viewer we will need to drop drawing them using the GL_LINES primitive since the line width is not unniversally configurable on all platforms. See here for more information.

Hopefully there should be some libraries out there that would offer good implementations for this. Even if the general idea behind emulating lines with triangles is easy, getting all the edge cases to work corretly and generate good looking correct lines is difficult.

AlexandruPopovici avatar Apr 26 '22 14:04 AlexandruPopovici

List of libraries/helpers

  • https://github.com/spite/THREE.MeshLine
  • https://github.com/mrdoob/three.js/blob/master/examples/webgl_lines_fat.html

AlexandruPopovici avatar Apr 26 '22 14:04 AlexandruPopovici