[vtkusers] Structured Grid
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Wed Nov 6 12:05:35 EST 2002
>>>>> "VZ" == Vahid Zahiri <vahid at elham.iut.ac.ir> writes:
VZ> Hello all I'm beginner . i created a Structured Grid
VZ> (vtkStructuredGrid) and add point to this Structured Grid.
VZ> Now i need add some other data to this Grid like velocity and
VZ> temp, any vector data or Scaler data . Can i add data to The
VZ> grid or must create other thing and add them to it?
Create a vtkFloatArray (or similar and for each point in your
structured grid, add the scalar to the array. Then set the scalars to
the point data of your structured grid.
sg = vtkStructuredGrid()
f = vtkFloatArray()
for i in range(sg.GetNumberOfPoints()):
f.InsertNextValue(insert_your_scalar_here)
sg.GetPointData().SetScalars(f)
cheers,
prabhu
More information about the vtkusers
mailing list