No subject


Thu Sep 19 15:20:57 EDT 2013


First, I am copying arrays in the PF, so I should be able to manipulate either input or output, but neither works 
It is also a composite (Exodus dataset) 

First version - error is can't find output.Points 

import math 

def process_block(block): 
   displ=block.PointData['DISPL'] 
   # Coords of Points are locked into individual Point structures 
   # Assume Displacements applied (Points are deformed) 
   numPts=output.GetNumberOfPoints() 
#   for i in range(numPts): 
#      #x_coords[i], y_coords[i], z_coords[i] = output.GetPoint(i) 

   x_coords=output.Points[:,0] 
   y_coords=output.Points[:,1] 
   z_coords=output.Points[:,2] 
   x_undef=x_coords-displ[:,0] 
   y_undef=y_coords-displ[:,1] 
   z_undef=z_coords-displ[:,2] 
   # Undeformed scalar Coordinates 
   block.PointData.append(x_undef,"X_undef") 
   block.PointData.append(y_undef,"Y_undef")   
   block.PointData.append(z_undef,"Z_undef") 
   # Deformed scalar Coordinates 
   block.PointData.append(x_coords,"X_def") 
   block.PointData.append(y_coords,"Y_def") 
   block.PointData.append(z_coords,"Z_def") 
   # Calc angles (no atan2 in vtk) 
   Angles_undef=math.atan2(z_undef,x_undef) 
   block.PointData.append(Angles_undef,"Angle_undef") 

for block in output: 
   process_block(block) 

For second version I comment out x_coords=output.Points[;0] and use 
#   for i in range(numPts): 
#      #x_coords[i], y_coords[i], z_coords[i] = output.GetPoint(i) 

This error is can't find output.GetPoint 

Both of these are used in examples online of Programmable Filter, so what am I missing? 
I have substituted input for output above and no change.   
Also, output.GetNumberOfPoints works, so why doesn't output.GetPoints work? 

Also, I don't understand what object I should examine to find all the member functions within Input and Output within the Programmable Filter

Thanks 



More information about the ParaView mailing list