[vtk-developers] vtkTriangle::IntersectWithLine hard test bug

Will Schroeder will.schroeder at kitware.com
Thu May 28 09:58:05 EDT 2015

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

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).


On Thu, May 28, 2015 at 9:22 AM, Mathieu Westphal <
mathieu.westphal at kitware.com> wrote:

> In vtkTriangle IntersectWithLine there is a "hard" part for when the easy
> test have not been able to compute intersection
> vtkTriangle.cxx:530
> However, the only way to reach this part of the code is when the test
> (evaluatePosition)  line 516 returns -1.
> 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.
> Then the following three tests, 539, 544, 555 will never succeed.
> So it looks like this "hard" code never succeed into finding intersection,
> which is not very important.
> Also degenerated triangle cannot be interessected, which is important.
> What do you think about it ?
> Mathieu Westphal
> _______________________________________________
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers

William J. Schroeder, PhD
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150528/e66e18e9/attachment.html>

More information about the vtk-developers mailing list