MantisBT - VTK
View Issue Details
0010860VTK(No Category)public2010-06-22 03:502016-08-12 09:55
Bryn Lloyd 
Kitware Robot 
normalmajoralways
closedmoved 
 
 
0010860: Unreliable return value in vtkOBBTree::IntersectWithLine(const double p1[3], const double p2[3], vtkPoints *, vtkIdList *)
The return value, which is supposed to tell me if the point p1 is inside or outside, is not reliable. Following addition to the code would make this function much more robust (vtkOBBTree.cxx, around line 888 ):

...
  delete [] senseList;
  delete [] cellList;
  delete [] distanceList;
  delete [] OBBstack;
  // return 1 if p1 is inside, 0 is p1 is outside
//---- begin added code ----
if(nPoints == 0)
  rval = 0;
else if(nPoints % 2)
  rval = 1;
else
  rval = -1;
//---- end added code ----
  return rval;
}


For this to work nPoints must be placed outside of the scope of
if (listSize != 0) {
...
}
at line 801.

This change will also make all functions using this function more robust, e.g. vtkOBBTree::InsideOrOutside.


I added a patch (diff oldvtkOBBTree.cxx newOBBTree.cxx).
800a801
> int nPoints = 0;
817d817
< int nPoints = 0;
892c892,901
< // return 1 if p1 is inside, 0 is p1 is outside
---
> // return 1 if p1 is inside, -1 is p1 is outside, 0 if no intersections
> //---- begin added code ----
> if(nPoints == 0)
> rval = 0;
> else if(nPoints % 2)
> rval = 1;
> else
> rval = -1;
> //---- end added code ----
>
No tags attached.
Issue History
2010-06-22 03:50Bryn LloydNew Issue
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037180
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0037180)
Kitware Robot   
2016-08-12 09:55   
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.