[vtkusers] Add a new scalar and array to vtkPolyData

Ahmad falahatpisheh at gmail.com
Thu Feb 9 00:43:07 EST 2012


I came to the following solution to extend 2D coordinate data to 3D
coordinate. Do you think there is a better way than looping through all the
points to add the value of z by the following code?

for-loop-through-all-points (i):
    double temp[3];
    polydata->GetPoints()->GetPoint(i,temp) ;    
    temp[2]=z[i];
    polydata->GetPoints()->SetPoint(i,temp[0],temp[1],temp[2]) ;
end-for-loop

--
View this message in context: http://vtk.1045678.n5.nabble.com/Add-a-new-scalar-and-array-to-vtkPolyData-tp5468245p5468679.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list