[vtkusers] streamline lengths, accessing vtkCellArrays

tom fogal tfogal at apollo.sr.unh.edu
Tue Dec 21 12:20:13 EST 2004


Hi all, I'm trying to compute the length of a streamline. The plan is
to use vtkStreamTracer to generate the streamline, and then pull the
line data out of the cell array it creates via vtkPolyData::GetLines().

I can't seem to find any examples to do what I'm looking for with
vtkCellArray::GetNextCell(). The objects I've been looking through
always seem to take the returned 'npts' and 'pts' and use them to
insert a new cell into another array, or somehow indirectly access the
data in the cells. If I give 'pts' as an argument to
vtkPolyData::GetCell(), will it give me back the cell i'm looking for?

The ideal goal would be a pair of (x,y,z) points that I could compute
the length of. Assuming the above will get me the correct cell, how
might I obtain the coordinates of the line that passes through it? I
suppose in the worst case I could approximate it via
sqrt(vtkCell::GetLength2()), but it seems to me that there should be an
easier way to do this.

Has anybody done this type of thing before? What route did you take?

Thanks,

-tom



More information about the vtkusers mailing list