View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010349VTK(No Category)public2010-03-01 09:012014-02-17 14:26
Reporterxabi riobe 
Assigned ToAndy Bauer 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version6.1.dev 
Summary0010349: vtkCellLocator precision issue
DescriptionThere is a numerical precision problem with the method vtkCellLocator::IntersectWithLine

in vtkCellLocator.cxx in line 287 of revision 1.89:
  if (cell->IntersectWithLine(a0, a1, tol, t, x, pcoords, subId) )
    {
    if ( ! this->IsInOctantBounds(x) )

sometimes the resulting intersection point returned by the cell->IntersectWithLine is a (0.000000000000004) little out of the bounds and the call to IsInOctantBounds discard the point.

I think it will be a good thing to add a tolerance to the method vtkCellLocator::IsInOctantBounds(double x[3]).
Steps To Reproducein the attached file there is an example that illustrates the issue.
a vtkCellLocator is filled with a cube and a line going from dPoint to dPoint2 intersect the box.
in Z axis, the bounds of the box are (1.0; -20)

if dPoint2[2] = -77.76333863288239, the resulting intersection point is at -20 and all is correct
if dPoint2[2] = -77.76333863288238, the resulting intersection point is at -20.000000000000004, so out of bounds.
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Filescpp file icon Intersect.cpp [^] (4,183 bytes) 2010-03-01 09:01
cxx file icon locatorbug.cxx [^] (7,930 bytes) 2013-04-25 13:49

 Relationships

  Notes
(0030576)
Steve Langer (reporter)
2013-04-16 16:53

I just ran into the same issue. It causes vtkPicker::Pick to choose the wrong object when resolving mouse clicks on the surface of a grid.

A solution would to remove the "if" at line 1242 of vtkCellLocator::BuildLocatorInternal in vtkCellLocator.cxx (version 5.10.1). Always increase the size of the bounding box to ensure that all cells are actually within the box, even if min!=max. This fixes the problem in my situation.
(0030623)
Steve Langer (reporter)
2013-04-25 13:51

I uploaded another file that illustrates the problem in a real world situation, distilled from a larger program. There are comments in the file explaining what's going on.
(0031656)
xabi riobe (reporter)
2013-09-30 04:34

The problem is still there in 6.0.0

add the following line to Intersect.cpp :
#define vtkRenderingCore_AUTOINIT 2(vtkInteractionStyle, vtkRenderingOpenGL)
(0031681)
xabi riobe (reporter)
2013-10-07 10:46

http://review.source.kitware.com/#/c/12936/ [^]
(0031982)
Dave DeMarle (administrator)
2013-12-17 13:11

proposed patch had problems in gerrit review
(0032342)
Andy Bauer (developer)
2014-02-17 14:26

Merged in through gerrit. Commit SHA is 618d6279992e23182093ef683ea25400267a09ce

 Issue History
Date Modified Username Field Change
2010-03-01 09:01 xabi riobe New Issue
2010-03-01 09:01 xabi riobe File Added: Intersect.cpp
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2012-03-07 03:57 xabi riobe Status expired => backlog
2012-03-07 03:57 xabi riobe Resolution open => reopened
2013-04-16 16:53 Steve Langer Note Added: 0030576
2013-04-25 13:49 Steve Langer File Added: locatorbug.cxx
2013-04-25 13:51 Steve Langer Note Added: 0030623
2013-09-30 04:34 xabi riobe Note Added: 0031656
2013-10-07 10:46 xabi riobe Note Added: 0031681
2013-10-07 10:46 xabi riobe Status backlog => gerrit review
2013-12-17 13:11 Dave DeMarle Note Added: 0031982
2013-12-17 13:11 Dave DeMarle Assigned To => Dave DeMarle
2013-12-17 13:11 Dave DeMarle Status gerrit review => backlog
2014-01-14 05:52 xabi riobe Status backlog => gerrit review
2014-02-17 14:25 Andy Bauer Project => TBD
2014-02-17 14:25 Andy Bauer Type => incorrect functionality
2014-02-17 14:25 Andy Bauer Assigned To Dave DeMarle => Andy Bauer
2014-02-17 14:26 Andy Bauer Note Added: 0032342
2014-02-17 14:26 Andy Bauer Status gerrit review => closed
2014-02-17 14:26 Andy Bauer Resolution reopened => fixed
2014-02-17 14:26 Andy Bauer Fixed in Version => 6.1.dev


Copyright © 2000 - 2018 MantisBT Team