<div dir="ltr">In the past I have encountered situations where picking (or some other operation that depends on intersect with line) failed due to degenerate triangles. So I suggest that we have to build a test to explicitly test for it.<div><br></div><div>For example, say you read in some polygonal soup that includes degenerate triangles (maybe zero area "needles" or even triangles collapsed to a point). Now you want to visually identify these bad triangles via picking, etc. For example you run a shrink filter that isolates the triangles so you can clearly see them (even if they are degenerate). If you remove the degenerate intersection code you may never be able to select these degenerate triangles (if using intersect with line).</div><div><br></div><div>W</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 28, 2015 at 9:22 AM, Mathieu Westphal <span dir="ltr"><<a href="mailto:mathieu.westphal@kitware.com" target="_blank">mathieu.westphal@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>In vtkTriangle IntersectWithLine there is a "hard" part for when the easy test have not been able to compute intersection<br>vtkTriangle.cxx:530<br><br></div>However, the only way to reach this part of the code is when the test (evaluatePosition)  line 516 returns -1.<br><br></div>The only way for vtkTriangle::evaluatePosition to return -1 is when the triangle is flat ( degenerated ), and in that case, pcoords are forced to zero.<br><br></div>Then the following three tests, 539, 544, 555 will never succeed.<br><br></div>So it looks like this "hard" code never succeed into finding intersection, which is not very important.<br></div>Also degenerated triangle cannot be interessected, which is important.<br><br></div>What do you think about it ?<span class="HOEnZb"><font color="#888888"><br><div><br clear="all"><div><div><div><div><div><div><div><div><div dir="ltr">Mathieu Westphal<br></div></div></div>
</div></div></div></div></div></div></div></font></span></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">William J. Schroeder, PhD<br>Kitware, Inc.<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>(518) 881-4902</div>
</div>