coordinates should not have random names
This commit is contained in:
parent
c00a203527
commit
8c8132bcd7
|
@ -51,9 +51,11 @@ class VTK:
|
||||||
"""
|
"""
|
||||||
geom = vtk.vtkRectilinearGrid()
|
geom = vtk.vtkRectilinearGrid()
|
||||||
geom.SetDimensions(*(grid+1))
|
geom.SetDimensions(*(grid+1))
|
||||||
geom.SetXCoordinates(np_to_vtk(np.linspace(origin[0],origin[0]+size[0],grid[0]+1),deep=True))
|
coord = [np_to_vtk(np.linspace(origin[i],origin[i]+size[i],grid[i]+1),deep=True) for i in [0,1,2]]
|
||||||
geom.SetYCoordinates(np_to_vtk(np.linspace(origin[1],origin[1]+size[1],grid[1]+1),deep=True))
|
[coord[i].SetName(n) for i,n in enumerate(['x','y','z'])]
|
||||||
geom.SetZCoordinates(np_to_vtk(np.linspace(origin[2],origin[2]+size[2],grid[2]+1),deep=True))
|
geom.SetXCoordinates(coord[0])
|
||||||
|
geom.SetYCoordinates(coord[1])
|
||||||
|
geom.SetZCoordinates(coord[2])
|
||||||
|
|
||||||
return VTK(geom)
|
return VTK(geom)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue