We need to create a method to react when the resolution is changed by the slider. Let’s first add a slider to control the resolution of the cone. Now we can start adding some UI to control some of the parameters that we want to interact with dynamically. We import the paraview module from trame.html import vuetify, paraview The rest of the code looks very similar to the VTK Hello trame example, but instead of importing the vtk module of trame from trame.html import vuetify, vtk Layout = SinglePage( "ParaView cone", on_ready=html_view.update) # html_view = paraview.VtkLocalView(view) # For local rendering Html_view = paraview.VtkRemoteView(view) # For remote rendering Now, we can use trame to show that view in the client. With these three lines, we create a full pipeline and a view. View = simple.Render() # Ask to compute image of active view and return the corresponding view Representation = simple.Show(cone) # Create a representation in a view (if no view, one is created) from paraview import simpleĬone = simple.Cone() # Create a source (reader, filter.) The SimpleCone.py example provides the core concepts needed to understand how to work with ParaView. ParaView use proxies which abstracts the VTK object handling so they can be easily distributed to support the processing of very large datasets.įor simplified usage, ParaView provides a simple package that lets us simply create and interact with these proxies. Applications/ParaView-5.10.0-RC1.app/Contents/bin/pvpython \ The command line below illustrate how a SimpleCone example can be run on a Mac computer where ParaView 5.10 has been installed. import # When using downloaded ParaView from KitwareĪfter that we can import trame and start using it (assuming we run our application with the -venv /path/to/venv/with/trame argument). Then later you can simply use python rather than pvpython conda activate pv-envĪt the very top of our scripts, we need to import our helper script so the -venv path/to/venv can be processed. conda create -n pv-env -c conda-forge paraview That way you can create a virtual-environment that can contain both ParaView and trame by doing the following. When using the conda approach you won’t need to download ParaView as it will get installed by conda for you. (So far 5.10 and 5.11 use Python 3.9)Ĭonda provide many open-source packages and ParaView is part of their offering. The python you use for creating your virtual-environment must match the Python version that comes with ParaView.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |