.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/00-basic-pyvista-examples/plain_usage.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_00-basic-pyvista-examples_plain_usage.py: .. _ref_plain_usage: =============== Use the plotter =============== This example shows how to add one or more meshes to the plotter. .. GENERATED FROM PYTHON SOURCE LINES 34-37 Add a mesh to the plotter ========================= This code shows how to add a single mesh to the plotter. .. GENERATED FROM PYTHON SOURCE LINES 37-55 .. code-block:: Python import pyvista as pv from ansys.tools.visualization_interface import Plotter mesh = pv.Cube() # Create a plotter pl = Plotter() # Add the mesh to the plotter pl.plot(mesh) # Show the plotter pl.show() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_001.png :alt: plain usage :srcset: /examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/runner/work/ansys-tools-visualization-interface/ansys-tools-visualization-interface/doc/source/examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_001.vtksz .. GENERATED FROM PYTHON SOURCE LINES 56-59 Getting a screenshot ==================== Now we will check how to get a screenshot from our plotter. .. GENERATED FROM PYTHON SOURCE LINES 59-76 .. code-block:: Python import pyvista as pv from ansys.tools.visualization_interface import Plotter mesh = pv.Cube() # Create a plotter pl = Plotter() # Add the mesh to the plotter pl.plot(mesh) # Show the plotter pl.show(screenshot="screenshot.png") .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_002.png :alt: plain usage :srcset: /examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_002.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/runner/work/ansys-tools-visualization-interface/ansys-tools-visualization-interface/doc/source/examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_002.vtksz .. GENERATED FROM PYTHON SOURCE LINES 77-80 Add a list of meshes ==================== This code shows how to add a list of meshes to the plotter. .. GENERATED FROM PYTHON SOURCE LINES 80-96 .. code-block:: Python import pyvista as pv from ansys.tools.visualization_interface import Plotter mesh1 = pv.Cube() mesh2 = pv.Sphere(center=(2, 0, 0)) mesh_list = [mesh1, mesh2] # Create a plotter pl = Plotter() # Add a list of meshes to the plotter pl.plot(mesh_list) # Show the plotter pl.show() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_003.png :alt: plain usage :srcset: /examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_003.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/runner/work/ansys-tools-visualization-interface/ansys-tools-visualization-interface/doc/source/examples/00-basic-pyvista-examples/images/sphx_glr_plain_usage_003.vtksz .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.039 seconds) .. _sphx_glr_download_examples_00-basic-pyvista-examples_plain_usage.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plain_usage.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plain_usage.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plain_usage.zip `