from pfcc_extras import view_ngl
from ase.io import read
atoms = read("filepath.xyz")
v = view_ngl(atoms, representations=["ball+stick"])
v
バックグラウンドカラーの変更
v.view.background = 'white' # "black"
bondの表示 / 非表示
v.view.add_ball_and_stick()
# v.view.remove_ball_and_stick()
カメラタイプの変更
v.view.camera= "perspective" # "orthographic"
cell boxの表示 / 非表示
v.view.remove_ball_and_stick
# v.view.add_unitcell()
ball上に原子のindex表示
v.view.add_label(
color="black", labelType="text",
labelText=[atoms[i].symbol + str(i) for i in range(atoms.get_global_number_of_atoms())],
zOffset=1.5, attachment='middle_center', radius=0.6)
回転
import numpy as np
v.view.control.spin([1,0,0.], np.deg2rad(-90))