#

PyVista contains a variety of built-in demos and downloadable example datasets.

Built-In#

Several built-in datasets are included and are available for offline use. For example, load the built-in load_random_hills() dataset:

>>> from pyvista import examples
>>> hills = examples.load_random_hills()
>>> hills.plot()
../../_images/index-1_00_00.png

See the API reference for more examples:

examples.examples

PyVistaに同梱されていて,ダウンロードする必要のない内蔵サンプル.

ダウンロード#

Many datasets are too large to be included with PyVista, but can be downloaded and cached locally. For example, we can download the download_turbine_blade() dataset:

>>> from pyvista import examples
>>> blade_mesh = examples.download_turbine_blade()
>>> blade_mesh.plot()
../../_images/index-2_00_003.png

See the API reference for more downloads:

examples.downloads

様々なソースから集められたダウンロード可能なデータセット.

Demos#

PyVista also contains some demos which can be used to quickly demonstrate features. For example, we can create and show the orientation cube plotter demo:

>>> from pyvista import demos
>>> plotter = demos.orientation_plotter()
>>> plotter.show()
../../_images/index-3_00_001.png

See the API reference for more demos:

demos.demos

PyVistaの機能を紹介するデモです.

Planets#

Examples of planets and celestial bodies are also included. See the API reference for details:

examples.planets

3D天体のデータセットがダウンロードできます.

3D Scene Datasets#

Some file formats are imported directly by the pyvista.Plotter instead of using pyvista.read(). These formats represent 3D geometry, materials, and scene structure.

Examples of file formats supported by PyVista include VRML (VirtualReality Modeling Language), 3DS (3D Studio), and glTF (Graphics Library Transmission Format). See the API reference for details:

examples.vrml

Contains vrml examples.

examples.download_3ds

Contains 3ds examples.

examples.gltf

Contains glTF examples.

セル#

Many examples of VTK cell types are available. These functions create single-cell pyvista.UnstructuredGrid objects which can be useful for learning about the different cells.

See the API reference for details:

examples.cells

Contains a variety of cells to serve as examples.

使用上の注意点#

警告

このリポジトリをご覧になり,3Dモデルやレンジデータセットをどのようにお使いになるかをお考えになる際には,これらの人工物の中には,宗教的または文化的に重要な意味を持つものがあることを覚えておいてください.何億人もの人々に崇拝されている宗教的なシンボルである仏陀とは別に,龍は中国文化のシンボルであり,タイの像はヒンズー教徒にとって宗教的に重要な要素を含んでおり,ルーシーはキリスト教の天使であり,イタリアの教会には彼女のような像がよく見られます.ルーシーはキリスト教の天使で,イタリアの教会によく見られる像です.これらのモデルのレンダリングやその他の使用は,趣味の良いものにしてください.アニメートやモーフィング,ブーリアン演算子の適用,(壊れたり爆発したり溶けたりするような)不快な現象のシミュレーションなどは行わないでください.この種の実験には別のモデルを選んでください.(Stanford大学のウサギやアルマジロには何をしてもいいです).

ダウンロードキャッシュとデータソース#

インターネット接続と通常のユーザーアカウントがあれば,PyVistaは問題なくサンプルをダウンロードしてキャッシュすることができるはずです.次の2つのセクションでは,PyVistaがサンプルをダウンロードする方法をカスタマイズしたい人について説明します.

キャッシュ#

PyVistaは, pooch を使ってサンプルファイルをダウンロードし,ローカルキャッシュに保存します.このキャッシュの場所は,実行時に次のようにして決定できます.

>>> from pyvista import examples
>>> # Get the local examples path on Linux
>>> examples.PATH
'/home/user/.cache/pyvista_3'

必要なら examples.delete_downloads() でローカルキャッシュをクリアすることができます.

このローカルキャッシュのパスを上書きしたい場合は, PYVISTA_USERDATA_PATH 環境変数を設定します.このパスは書き込み可能である必要があります.

データソース#

PyVistaは,サンプルデータの主なソースとして PyVista/vtk-data を使用します.インターネットに接続できない場合や,ローカルディレクトリやネットワークディレクトリを使いたい場合は,環境変数 VTK_DATA_PATH でこのソースをオーバーライドすることができます.

次の例では,まず git リポジトリをクローンし,そのディレクトリを VTK_DATA_PATH 経由で PyVista にエクスポートしています.パスが 'Data' で終わっていることに注意してください.これは, pooch のためにデータの正確なディレクトリを指定する必要があるためです.

git clone https://github.com/pyvista/vtk-data.git
export VTK_DATA_PATH=/home/alex/python/vtk-data/Data