pyvista.read_texture

pyvista.read_texture#

read_texture(filename: str | Path, progress_bar: bool = False) Texture[ソース]#

画像ファイルからテクスチャを読み込みます.

vtk がサポートするあらゆるファイルタイプの読み込みを試みますが,失敗した場合は imageio を使用してファイルの読み込みを試みます.

パラメータ:
filenamestr

読み込むテクスチャファイルのパスです.

progress_barbool, default: False

オプションでプログレスバーを表示します.

戻り値:
pyvista.Texture

PyVistaのテクスチャオブジェクト.

例のjpgマップファイルをテクスチャとして読み込みます.

>>> from pathlib import Path
>>> import pyvista as pv
>>> from pyvista import examples
>>> Path(examples.mapfile).name
'2k_earth_daymap.jpg'
>>> texture = pv.read_texture(examples.mapfile)
>>> type(texture)
<class 'pyvista.plotting.texture.Texture'>