[vtkusers] Sampling cell-data along a line

Timofey Mukha timofey.mukha at it.uu.se
Tue Nov 22 05:07:15 EST 2016

Dear all,

I have some large cell-data from a CFD simulation. I would like to view 
profiles along a line.
Currently I understand that I can do this with a probeFilter to which I 
feed a line with a given resolution.

The problem is that given a complicated mesh the sampling points on the 
line will probably miss some cells or, on the other hand, some points 
might fall into the same cell.

Is there a way to sample along a line in such a way that the returned 
profile will contain data from all the cells that the line intersects? 
For each cell a sampling point should then be generated somewhere in 
between the point where the line enters the cell and where it exists it.

I tried playing around with the vtkCellLocator, that can find which 
cells are intersected by a given line using the FindCellsAlongLine 
method. However, that does not give the locations of the sampling 
points, only the coordinates of the cell-centers that are intersected by 
the line. There is also the subtle issue of handling cases when the 
sampling line lies on a boundary between two or more cells.

All in all it seems like a more complicated problem than at first 
glance, but I am wondering if someone has already dealt with it before me?



More information about the vtkusers mailing list