MantisBT - VTK
View Issue Details
0012331VTK(No Category)public2011-07-03 21:442013-12-13 10:05
Peter Wood 
Dave DeMarle 
normalminorhave not tried
closedfixed 
 
6.1.0 
TBD
incorrect functionality
0012331: Tolerance problem in 'vtkImplicitDataSet::EvaluateFunction': 'tol2' set as 0.0, which appears to be too tight
Tolerance problem in 'vtkImplicitDataSet.cxx' in method
'EvaluateFunction' line 81, as follows

"""
// Find the cell that contains xyz and get it
cell = this->DataSet->FindAndGetCell(x,NULL,-1,0.0,subId,pcoords,this->Weights);
                                               ^^^
"""

Note 4th parameter '0.0'. This is 'tol2' in API, which is used in
'vtkPointSet.cxx' in method 'FindCellWalk'

"""
    double dist2;
    if ( (cell->EvaluatePosition(x, closestPoint, subId,
                                   pcoords, dist2, weights) == 1)
        && (dist2 <= tol2) )
      {
      return cellId;
      }
"""

The problem is that 'tol2' is 0.0, but often 'dist2' may be calculated
to be approx 1e-032 to 1e-029, a very small number, but still greater
than 0.0! (NB: I adapted vtkPointSet.cxx to report 'dist2')

To fix this problem, when calling 'FindAndGetCell' in
'vtkImplicitDataSet' replace '0.0' with an appropriate small positive
tolerance value, e.g. '1e-16'. This could be user-configurable?
No tags attached.
? test_vtkImplicitDataSet_tol2_problem.py (2,732) 2011-07-03 21:44
https://www.vtk.org/Bug/file/8970/test_vtkImplicitDataSet_tol2_problem.py
Issue History
2011-07-03 21:44Peter WoodNew Issue
2011-07-03 21:44Peter WoodFile Added: test_vtkImplicitDataSet_tol2_problem.py
2011-07-03 22:43Peter WoodNote Added: 0026947
2013-06-05 13:20Jean-Christophe Fillion-RobinNote Added: 0030898
2013-12-13 10:05Dave DeMarleNote Added: 0031928
2013-12-13 10:05Dave DeMarleStatusbacklog => closed
2013-12-13 10:05Dave DeMarleAssigned To => Dave DeMarle
2013-12-13 10:05Dave DeMarleResolutionopen => fixed
2013-12-13 10:05Dave DeMarleFixed in Version => 6.1.0

Notes
(0026947)
Peter Wood   
2011-07-03 22:43   
One option may be to replace '0.0' with VTK_DBL_EPSILON ?
(0030898)
Jean-Christophe Fillion-Robin   
2013-06-05 13:20   
Does the problem still occur with VTK 5.10 ? VTK 6 ?

Would be great if you could submit a patch using Gerrit. For more details see http://www.vtk.org/Wiki/VTK/Git/Develop [^]

Thanks
Jc
(0031928)
Dave DeMarle   
2013-12-13 10:05   
http://review.source.kitware.com/#/t/3022/ [^]
merged