[vtkusers] Probing a vtkUnstructuredGrid with a vtkDelaunay2D surface

JimRobinson j.robinson at kepler-systems.com
Sat Dec 8 11:43:48 EST 2018


Dear All,

I am trying to develop a utility in my data visualization software whereby I
can take a vtkUnstructuredGrid with scalar and vector values at the points
and find the interpolated value of the scalar or vector field on the surface
(essentially at the points) defined by a vtkDelaunay2D object. 

This is easy to do if the probing surface is a plane (so therefore defined
by a function) or, I imagine, if the probing surface is defined by any
function. 

I have managed to do it using a vtkProbeFilter, whereby I set the probing
surface to be the vtkDelaunay2D (below - _TIN) and the source data as the
vtkUnstructuredGrid (_USGrid). The following nearly gets there:

            vtkProbeFilter _BathymetryProbeFilter = new vtkProbeFilter();
            _BathymetryProbeFilter.SetInputData(_TIN.GetOutput());
            _BathymetryProbeFilter.SetSourceData(_USGrid);

However, if the _TIN protrudes from the _USGrid, then the algorithms can't
interpolate a field value at the points of the _TIN that are outside of the
_USGrid, and so it sets them to zero. This means that the resulting colour
map is wrong.

Here is a randomly generated vtkUnstructuredGrid with the field values
simply being the altitude (z value) at each point.


<http://vtk.1045678.n5.nabble.com/file/t342484/vtkIMage1.jpg> 

And we see the vtkDelaunay2D surface shows good results (displaying the
correct altitudes) when that surface is entirely inside the
vtkUnstructuredGrid volume. 

<http://vtk.1045678.n5.nabble.com/file/t342484/vtkIMage2.jpg> 

However, when the surface protrudes from the top of the vtkUnstructuredGrid
volume, is where we get the incorrect interpolation:

<http://vtk.1045678.n5.nabble.com/file/t342484/vtkIMage3.jpg> 

What I need is the vtkDelaunay2D to be clipped when it protrudes from the
vtkUnstructuredGrid.

Any thoughts on how this might be achieved would be much appreciated.

Regards,

Jim






--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list