[vtkusers] Displaying Hedgeogs at cell centers

Rainer Sabelka sabelka at iue.tuwien.ac.at
Wed Nov 22 10:02:45 EST 2000


Jeff Lee wrote:

> Hi all,
> I have an unstructured grid dataset with cell data consisting of vectors
> and scalars.  I am using a vtkUnstructuredGridReader to read the data
> file and am trying to plot vectors at the cell centroids.  It seems that
> functions like vtkHedgeHog and vtk3DGlyph take only point data as
> arguments, and I can use these if I convert my data using
> vtkCellDataToPointData, but the data is cell data and I want the vectors
> plotted at cell centers, not at cell vertices.  My question is, what
> would be the best way to display the vectors at cell-centers?  Any help
> would be greatly appreciated,
> -Jeff

just a guess - no garatee this will work:

1. use vtkShrinkFilter with a ShrinkFactor of 0 to reduce the cells to their centroids.
2. use vtkCellDataToPointData to convert the attribute data
3. convert to PolyData with vtkGeometryFilter
4. use vtkCleanPolyData to remove duplicate Points

... but maybe there is also an easier solution.

Cheers,
Rainer






More information about the vtkusers mailing list