> dir(servermanager.filters) Help about any filter > help()ġ5 Connecting to a particular output portĬonnecting to the first output port > shrink.Input = inFilter > shrink.Input = servermanager.OutputPort(inFilter, 0) Connecting to any other output port > shrink.Input = servermanager.OutputPort(inFilter, 1)ġ6 Rendering Views Representations Window to display data in …ġ2 Changing Parameters help(obj or class) can be used to obtain the list of available parameters Getting the current value > param = sphere.Radius > center0 = sphere.Center Setting a new value > sphere.Radius = 10 > sphere.Center = > sphere.Center = > reprSphere.Representation = “Wireframe” Parameter values can be specified when instantiating > sphere = (Radius=10.5, Center= )ġ3 Using Filters Filters are available in servermanager.filters sub-module Similar to creating sources, with required Input > shrink = (Input=sphere) > shrink.ShrinkFactor = 0.8 > repShrink = servermanager.CreateRepresentation(shrink, view) > view.StillRender()ġ4 More about filters List available filters (See the Start Phi and End Phi properties.) The phi divisions are similar to latitude lines on the earth. PhiResolution The value of this property represents the number of divisions between Start Phi and End Phi on the sphere. EndPhi The value of this property can be adjusted to form only a portion of a sphere. The output of the Sphere source is polygonal data with point normals defined Data descriptors defined here: Center This property specifies the 3D coordinates for the center of the sphere. List all available classes: > dir(servermanager.sources) Documentation for each class: > help()ġ1 help()Ĭlass SphereSource(SourceProxy) The Sphere source can be used to add a polygonal sphere to the 3D scene. animation – collection of animation components eg. rendering – collection of rendering items eg. filters – collection of data processors eg. ConeSource, SphereSource, ExodusIIReader etc. Servermanager module sub-modules: sources – collection of data sources/readers eg. Import ParaView’s python module > from paraview import servermanager Connect to a server For standalone operation (or batch mode) > servermanager.Connect() For additional help on Connect > help(servermanager.Connect) Connect() returns a connection object on success or None on failureĬonnect to pvserver running on amber > connection = servermanager.Connect(“amber”) Connect to pvdataserver running on amber at port and pvrenderserver running on destiny at port 10235 > connection = servermanager.Connect(“amber”,10234,“destiny”,“10235”) Sets servermanager.ActiveConnection to the connection object To disconnect from the server > servermanager.Disconnect()ĩ Creating a simple visualization (sphere.py)Ĭreate a sphere > sphere= () Create a view to show the sphere > view = servermanager.CreateRenderView() Show the sphere in the view > repSphere = servermanager.CreateRepresentation(sphere, view) Render > view.ResetCamera() > view.StillRender() Standard python interpreter (python) Set PYTHON_PATH to directory containing ParaView modules Import relevant ParaView modules ParaView’s python client (pvpython) Python interpreter with ParaView initialization plus sets the path to ParaView modules ParaView’s batch client (pvbatch) Same as pvpython without remote server connection capabilities Can be run in parallel (using mpirun etc.) ParaView GUI (paraview) GUI provides python shell comparable to pvpython Python for data processing Python Programmable filterĬlient – Server (pvpython + pvserver) Client – Render Server – Data Server (pvpython + pvdataserver + pvrenderserver) scipy, numpyĬMake Variables PARAVIEW_ENABLE_PYTHON: ON Must be ON to enable python support PARAVIEW_USE_MPI: ON | OFF Must be ON for MPI enabled server/pvbatch PARAVIEW_BUILD_QT_GUI: ON | OFF Must be ON to build the ParaView’s Qt-based UI Binaries provided on are built with python support enabled.Ĥ Python in ParaView ParaView’s batch client (pvbatch) Used for batch processing Only means to visualize on supercomputers Python Cross-platform, easily extensible Object-oriented Supported by a huge community of avid developers and programmers Packages available for different domains eg. 2 Motivation Scripting Python Makes automation possible
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |