MantisBT - VTK
View Issue Details
0000721VTK(No Category)public2004-03-26 21:542016-08-12 09:54
Goodwin Lawlor 
David Partyka 
urgentmajoralways
closedmoved 
 
 
0000721: Picking a vtkPolyData with degenerate cells
If a degenerate triangle with two identical vertices is traversed by vtkCellPicker, a crash is caused.

Stack:
vtkPicker::Pick
vtkCellPicker::IntersectWithLine
vtkTriangle::IntersectWithLine
vtkTriangle::EvaluatePosition
vtkLine::DistanceToLine

"denom" on line 272 (vtkLine.cxx) will evaluate to zero and will cause a division by zero error.
Perhaps, a check here to return -1 if denom == 0, then a check in vtkTriangle::EvaluatePosition to return -1 (ie numerical error) if vtkLine::DistanceToLine returns -1
vtkTriangle::IntersectWithLine should also check for a error from vtkTriangle::EvaluatePosition and vtkLine::DistanceToLine and return 0;
No tags attached.
patch vtkLine.cxx.patch (578) 1969-12-31 19:00
https://www.vtk.org/Bug/file/5137/vtkLine.cxx.patch
patch vtkTriangle.cxx.patch (597) 1969-12-31 19:00
https://www.vtk.org/Bug/file/5138/vtkTriangle.cxx.patch
Issue History
2008-11-30 09:17Mathieu MalaterreAssigned ToMathieu Malaterre => David Cole
2011-01-19 08:52Utkarsh AyachitAssigned ToDavid Cole => David Partyka
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-07-22 20:33Dave DeMarleStatusbacklog => expired
2013-07-22 20:33Dave DeMarleNote Added: 0031303
2016-08-12 09:54Kitware RobotNote Added: 0036721
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0000821)
Goodwin Lawlor   
2004-03-26 23:40   
Rather than vtkTriangle::IntersectWithLine checking return values from vtkTriangle::EvaluatePosition and vtkLine::DistanceToLine, maybe just a check at the beginning of the method to see if the triangle is degenerate.

If fact perhaps every cell type should have a method to check itself for degeneracy, and each cell method should use this check before it executes.
(0000836)
Mathieu Malaterre   
2004-03-30 18:39   
Waht does :
vtkTriangle::ComputeNormal (pt1, pt2, pt3, n);

return in your case. Maybe we can check the result to determine if the triangle is degenerate.
(0001334)
Goodwin Lawlor   
2004-08-03 19:47   
Uploaded two patches that fix a crash after cell picking a band-contoured polydata, ie, a polydata that could have some degenerate cells.
(0031303)
Dave DeMarle   
2013-07-22 20:33   
Dave P no longer works on the project. If these old issues still exist in 6.0.0, reopen them and assign to Dave DeMarle
(0036721)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.