/usr/share/doc/python-pyvtk/examples/example2.py is in python-pyvtk 0.4.74-3build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #!/usr/bin/env python
from pyvtk import *
vtk = VtkData(StructuredPoints([3,4,6]),
PointData(Scalars([0,0,0,0,0,0,0,0,0,0,0,0,
0,5,10,15,20,25,25,20,15,10,5,0,
0,10,20,30,40,50,50,40,30,20,10,0,
0,10,20,30,40,50,50,40,30,20,10,0,
0,5,10,15,20,25,25,20,15,10,5,0,
0,0,0,0,0,0,0,0,0,0,0,0
])))
vtk.tofile('example2')
vtk.tofile('example2b','binary')
vtk = VtkData('example2',only_structure = 1)
def f(x,y,z):
return x*y*z
vtk.point_data.append(vtk.structure.Scalars(f,'x*y*z'))
vtk.tofile('example2f_sp')
pp = [(i,j,k) for k in range(6) for j in range(4) for i in range(3)]
vtk = VtkData(StructuredGrid([3,4,6],pp))
vtk.point_data.append(vtk.structure.Scalars(f,'x*y*z'))
vtk.tofile('example2f_sg')
vtk = VtkData(RectilinearGrid(range(3),range(4),range(6)))
vtk.point_data.append(vtk.structure.Scalars(f,'x*y*z'))
vtk.tofile('example2f_rg')
voxels = []
points = []
n = 0
for k in range(6):
for j in range(4):
for i in range(3):
points.append((i,j,k))
if not (k==5 or j==3 or i==2):
voxels.append([n,n+1,n+3,n+3+1,n+3*4,n+3*4+1,n+3*4+3,n+3*4+3+1])
n += 1
vtk = VtkData(UnstructuredGrid(points,voxel=voxels))
vtk.point_data.append(vtk.structure.Scalars(f,'x*y*z'))
vtk.tofile('example2f_usg')
|