Tolerance problem in 'vtkImplicitDataSet::EvaluateFunction': 'tol2' set as 0.0, which appears to be too tight
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
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?