Added python script to generate the figures.

This commit is contained in:
Xavier Raynaud
2012-04-10 17:24:20 +02:00
parent 18a4d47afd
commit 3d06f3eb9d

26
generate_doc_figures.py Executable file
View File

@@ -0,0 +1,26 @@
from subprocess import call
from paraview.simple import *
from paraview import servermanager
call("examples/tutorial1")
connection = servermanager.Connect()
grid = servermanager.sources.XMLUnstructuredGridReader(FileName="tutorial1.vtu")
call("rm tutorial1.vtu")
grid.UpdatePipeline()
Show(grid)
dp = GetDisplayProperties(grid)
dp.Representation = 'Wireframe'
dp.LineWidth = 5
dp.AmbientColor = [1, 0, 0]
view = GetActiveView()
view.Background = [1, 1, 1]
camera = GetActiveCamera()
camera.SetViewUp(0.5,0.3,0.7)
camera.SetViewAngle(30)
camera.SetFocalPoint(1,1,0.5)
Render()
WriteImage("Figure/tutorial1.png")