Use arguments as file names when calling the functions in ReadPoints.py.ĭata.GetPointData().SetVectors(readVectors(sys.argv)) Read the data into a vtkUnstructuredGrid() using the functions in ReadPoints.py. Import the function readPoints from the ReadPoints.py file explained in: Reader for ASCII Files. Import sys so that you can pass arguments to the program. Vtkpython BallsArrows.py Data2.txt Data1.txt Vtkpython BallsArrows.py Data1.txt Data2.txtĪs the files contains data in a similar format you can actually changes positions of the file in the call. The third function readScalars() are used in the exercises, for which you need the file Data3.txt.
The functions readPoints() and readVectors() are called from the main program. You also need the Reader for ASCII Files. The code is found here BallsArrows.py and the files Data1.txt, Data2.txt. One file 'Data1.txt' contains the position and the other 'Data2.txt' contains a vector. The program visualises vector data from Matlab using Glyphs.