title: 3D mesh edge detection / feature line computation algorithm
body: <p>I have a program that visualizes triangular meshes and allows the users to draw on the meshes using a pen. I want to have a "snapping" mode in my system. The snapping mode performs drawing corrections for the user in the sense that the user-drawn lines are snapped to the nearest edge (or the silhouette) of that part of the mesh.</p>
  
  <p>I'm looking for an algorithm that compute the edges visible on the mesh from a given point of view. By edges, I'm referring to the outlines of the shape: corner points and the lines between them (similar to the definition of an edge in computer vision/image processing -- such as Canny edges).</p>
  
  <p>So far I've thought of two approaches for this:</p>
  
  <ol>
  <li><p>Edge detection: so far I've only found <a href="http://imaging.utk.edu/~koschan/paper/ICIP02_ys.pdf" rel="nofollow noreferrer">this paper</a>. Their method is understandable, yet the implementation is not trivial (due to tensor computations and some ambiguity in their explanations). The problem with this approach is that it produces "edge strength values" which is a value in the range [0, 1] for every vertex. The value of 1 indicates an edge vertex with a high confidence. This introduces extra thresholding parameters in the system which I'd rather not have. Their output looks like this (range [0, 1] scaled to [0, 65535]):
  <a href="https://i.stack.imgur.com/nAbLn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nAbLn.png" alt="enter image description here"></a></p></li>
  <li><p>Rendering or non-photorealistic methods such as the one asked in <a href="https://gamedev.stackexchange.com/questions/68401/how-can-i-draw-outlines-around-3d-models">this question</a> or <a href="http://www.sci.utah.edu/~roni/research/projects/NPR-lines/NPR-lines.NPAR09.pdf" rel="nofollow noreferrer">this paper</a>. They seem to be able to create the silhouette that I'm after as can be seen below:<a href="https://i.stack.imgur.com/W1HF5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W1HF5.png" alt="enter image description here"></a>
  I'm not a graphics expert and as of yet I don't know whether their methods can be used for computation of the feature lines rather than rendering.</p></li>
  </ol>
  
  <p>I was wondering if anybody has any ideas about a good algorithm for what I want to do. Since the system is very interactive, the performance is important. The snapping feature does not have to be enabled all the time (therefore, if the method is computationally expensive, some delay in when "snapping enabled" mode is toggled can be tolerated while the algorithm is computing the edges.) Also, if you know of any implementation (preferably open source), I'd be grateful if you could share it with me.</p>