[vtkusers] Problems creating new vtkProbeSurfaceFilter - Help ?

John Biddiscombe j.biddiscombe at rl.ac.uk
Wed Jul 5 07:30:03 EDT 2000


Dear Anyone,

I have a surface generated from some data and I want to probe the values on
the surface at points. I couldn't find a filter to do it, so I've created
vtkProbeSurfaceFilter which I'll check in soon. Here's how it works - and a
problem I would like to fix before checking it in.

Input is
dataset (any will do but polydata is nice)
test points ( the points from any vtkPointSet subclass are used)

test point may have vectors/normals in PointData or alternatively a single
probe vector is supplied and used for all points.

The filter takes every point and fires a ray from it along the vector. For
a single probe vector, all rays go in the same direction, but if
vectors/normals are supplied, they can all go off anywhere.
When the ray intersects the surface, it will fetch either
a) the x coord of the surface hit
b) the y coord 
c) the z coord 
d) perform
  cell->EvaluateLocation(subId, pcoords, ipoint, weights);
  out_PD->InterpolatePoint(sur_PD, i, cell->PointIds, weights);

ie interpolate point data at the hit point (like vtkProbeFilter except on
surface - instead of inside cell).

if I generate a surface and return z coords of hit points, then warp the
returned points and plot them, they lie perfectly on the surface
http://users.rcru.rl.ac.uk/jab53/vtk/good_surface.gif

If I use Elevation filter to generate scalars for the surface(=z coord),
then fire rays and interpolate the scalars for each hit point using d)
above and return the scalar value of the surface - then warp it and plot it
- I get this
http://users.rcru.rl.ac.uk/jab53/vtk/bad_surface.gif

Interesting isn't it. The points are close, but off slightly. I suspect
numerical errors rounding during either
  cell->EvaluateLocation(subId, pcoords, ipoint, weights);
or
  out_PD->InterpolatePoint(sur_PD, i, cell->PointIds, weights);

(or conceivably during elevation filter)

Anyone got any ideas?

John B







More information about the vtkusers mailing list