pyvista.read_texture#
- read_texture(filename: str | Path, progress_bar: bool = False) Texture[ソース]#
画像ファイルからテクスチャを読み込みます.
vtkがサポートするあらゆるファイルタイプの読み込みを試みますが,失敗した場合はimageioを使用してファイルの読み込みを試みます.- パラメータ:
- 戻り値:
pyvista.TexturePyVistaのテクスチャオブジェクト.
例
例の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'>