Problem: FindCell with a 2D StructuredPoints

W.D.Miners at rl.ac.uk W.D.Miners at rl.ac.uk
Wed Jul 28 06:03:08 EDT 1999


I'm having a problem with vtkStructuredPoints or my understanding or
implementation. 

I'm trying to find the interpolated value at a point {x,y} on a 2D 
structuredpoints array using FindCell.

If I use: vtkStructuredPoint::FindCell it calls up
vtkStructuredPoints::ComputeStructuredCoordinates which has this in it:

  //
  //  Compute the ijk location
  //
  for (i=0; i<3; i++) 
    {
    d = x[i] - this->Origin[i];
    floatLoc = d / this->Spacing[i];

But as dealing with a 2D array the spacing in the third dimension is zero so
there is a floating point error when it tries to divide by zero.

A similar failure due to division by a spacing of zero occurs in
vtkStructuredPoints::FindPoint.


********** Question 1***********
Have I set up the 2D structuredPoints array incorrectly?  What else should
the spacing in the third dimension be?   In the VTK 2nd Edition book, on
page 598 under the description of the Structured Points DataSet format, it
says that the data spacing in all dimensions must be greater than zero.   


****** Question 2 ********
Is there a better way to do the interpolation?


Many thanks for any help forthcoming.  

Bill


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list