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

Bill Lorensen bill.lorensen at gmail.com
Thu May 28 10:09:44 EDT 2015


According to this coverage report,
http://lorensen.github.io/VTKCodeCoverage/VTK/Common/DataModel/vtkTriangle.cxx.gcov.html

the "hard" code is never tested.


On Thu, May 28, 2015 at 9:58 AM, Will Schroeder
<will.schroeder at kitware.com> wrote:
> 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.
>
> 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).
>
> W
>
> 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
> http://www.kitware.com
> (518) 881-4902
>
> _______________________________________________
> 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
>
>



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtk-developers mailing list