[vtkusers] isosurface plane through an vtkUnstructuredGrid
Arne Mittelstaedt
a.mittelstaedt at tu-bs.de
Sun Aug 15 08:01:37 EDT 2004
Hi,
I want to realize an isoSurface-plane through a vtkUnstructuredGrid with
FlowData (points in space, vectors for direction and scalar-Values for
velocity). Have anyone an example for that? I will describe it more
specific:
So far I have a solution with Glyph3D(cones), defining a vtkPlane and a
vtkPlaneCut with Glyph Input (see source at bottom). It looks nice, but it
remember to videogames from 1980. Which pipeline I have to build, so that
the an isosurface plane represent the scalar values from my
UnstructuredGrid? And coloring into a range (blue für small, red for high
velocity)?
Another way I was thinking over are Streamlines, but I have never found an
Example for Streamlines that can take Data from an unstructuredGrid.
How can I realize such plane/streamline? Does I have to convert the
UnstructuredGridData into another Dataset?
Thank you very much in advance
Arne Mittelstaedt
----------------------------
vtkUnstructuredGrid ugrid = new vtkUnstructuredGrid();
for (int i = 0; i < nodes.length; i++)
{
(...) //Read Data from Flow Simulation
points.InsertPoint(i, x1, x2, x3); //so far symmetrical values
scalars.InsertValue(i, s);
vectors.InsertTuple3(i, v1, v2, v3);
}
ugrid.setPoints(points);
ugrid.setPointScalars(scalars);
ugrid.setPointVectors(vectors);
vtkConeSource cones = new vtkConeSource();
vtkGlyph3D glyph = new vtkGlyph3D();
glyph.SetInput(ugrid); //the unstructuredGrid
glyph.SetSource(cones.GetOutput());
glyph.SetColorModeToColorByScalar();
vtkPlane plane = new vtkPlane();
plane.SetNormal(0.0, 0.0, 1.0);
vtkCutter planeCut = new vtkCutter();
planeCut.SetInput(glyph.GetOutput());
planeCut.SetCutFunction(plane);
vtkPolyDataMapper cutMapper = new vtkPolyDataMapper();
cutMapper.SetInput(planeCut.GetOutput());
More information about the vtkusers
mailing list