[vtk-developers] [VTK 0012331]: Tolerance problem in 'vtkImplicitDataSet::EvaluateFunction': 'tol2' set as 0.0, which appears to be too tight

Mantis Bug Tracker mantis at public.kitware.com
Sun Jul 3 21:44:42 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://www.vtk.org/Bug/view.php?id=12331 
====================================================================== 
Reported By:                Peter Wood
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   12331
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       incorrect functionality 
====================================================================== 
Date Submitted:             2011-07-03 21:44 EDT
Last Modified:              2011-07-03 21:44 EDT
====================================================================== 
Summary:                    Tolerance problem in
'vtkImplicitDataSet::EvaluateFunction': 'tol2' set as 0.0, which appears to be
too tight
Description: 
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?
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-07-03 21:44 Peter Wood     New Issue                                    
2011-07-03 21:44 Peter Wood     File Added:
test_vtkImplicitDataSet_tol2_problem.py                    
======================================================================




More information about the vtk-developers mailing list