pyvista.examples.downloads.download_m4_total_density

pyvista.examples.downloads.download_m4_total_density#

download_m4_total_density(load=True)[ソース]#

Download a total density dataset of the chemistry.

パラメータ:
loadbool, default: True

True に設定すると,データセットをダウンロードした後に読み込みます. False に設定すると,ファイル名のみが返されます.

戻り値:
pyvista.ImageData | str

load に応じて,データセットまたはファイル名を指定します.

>>> import pyvista as pv
>>> from pyvista import examples
>>> filename = examples.download_m4_total_density(load=False)
>>> reader = pv.get_reader(filename)
>>> reader.hb_scale = 1.1
>>> reader.b_scale = 10.0
>>> grid = reader.read()
>>> poly = reader.read(grid=False)

Add the outline and volume to the plotter.

>>> pl = pv.Plotter()
>>> outline = pl.add_mesh(grid.outline(), color='black')
>>> volume = pl.add_volume(grid)

Add atoms and bonds to the plotter.

>>> atoms = pl.add_mesh(poly.glyph(geom=pv.Sphere()), color='red')
>>> bonds = pl.add_mesh(poly.tube(), color='white')
>>> pl.show(cpos='zx')
../../../_images/pyvista-examples-downloads-download_m4_total_density-1_00_00.png

参考

M4 Total Density Dataset

詳細はデータセットギャラリーのこのデータセットをご覧ください。