vtkStaticCellLocator::FindCellsAlongLine results not reliable
A slight variation of P1 and P2 can make the result of FindCellsAlongLine
looks totally different. Here's a quick example of how to reproduce the problem (see attached for full program) :
constexpr int SIZE = 20;
vtkNew<vtkRTAnalyticSource> wavelet;
wavelet->SetWholeExtent(0, SIZE, 0, SIZE, 0, SIZE);
wavelet->Update();
// Create the tree
vtkNew<vtkStaticCellLocator> locator;
locator->SetDataSet((vtkDataSet*)wavelet->GetOutput());
locator->UseDiagonalLengthToleranceOff();
locator->SetTolerance(0.0);
locator->BuildLocator();
constexpr double EPSILON = 0.01;
// Line (p1,p2) intersecting all cells on the diagonal of the wavelet (and more)
double p1[] = {0, 0, 0};
double p2[] = {SIZE + EPSILON, SIZE + EPSILON, SIZE + EPSILON};
vtkNew<vtkIdList> cells;
locator->FindCellsAlongLine(p1, p2, 0.0, cells);
For SIZE = 20
, EPSILON = 0.0
do not find 19th and 20th cells on the diagonal, EPSILON = 0.01
do not find the 12th but EPSILON = 0.1
find them all. SEQUENTIAL
and STDTHREAD
backends give the same result. UseDiagonalLengthToleranceOff()
and SetTolerance(0.0)
does not have any effect on the result.
This invalidate the new implementation of ProbeOverLine
thus !8222 (merged) may need to be reverted.
Edited by Timothee Chabat