Skip to content

Commit

Permalink
Simplified screen
Browse files Browse the repository at this point in the history
  • Loading branch information
YHordijk committed Nov 5, 2024
1 parent 29f5247 commit 58ffdc0
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions src/tcviewer/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,29 @@ def screenshots(self, *args, **kwargs):


if __name__ == '__main__':
with Screen(headless=True) as scr:
with scr.add_molscene() as scene:
res = tcutility.results.read('/Users/yumanhordijk/PhD/Projects/RadicalAdditionASMEDA/data/DFT/TS_C_O/PyFrag_OLYP_TZ2P/frag_Substrate')
# orbs = pyfmo.orbitals.Orbitals(res.files['adf.rkf'])

# cub = orbs.mos['LUMO'].cube_file()
# mol = cub.molecule
mol = res.molecule.input

T = tcutility.geometry.MolTransform(mol)
T.center(1) # center on C1
T.align_to_vector(1, 2, [1, 0, 0]) # put C=O bond on x-axis
T.align_to_plane(2, 1, 4, [0, 1, 0]) # place the molecule on the xz-plane
# T.rotate(x=7 * np.pi / 180)
scene.transform = T.to_vtkTransform()

actor = scene.draw_molecule(mol)
# actor = scene.draw_isosurface(cub, -0.03, [1, .5, 0])
# actor = scene.draw_isosurface(cub, 0.03, [0, 1, 1])

scr.screenshots(directory='screenshots')
with Screen(headless=False) as scr:
...
# with scr.add_molscene() as scene:
# # res = tcutility.results.read('/Users/yumanhordijk/PhD/Projects/RadicalAdditionASMEDA/data/DFT/TS_C_O/PyFrag_OLYP_TZ2P/frag_Substrate')
# orbs = pyfmo.orbitals2.objects.Orbitals('/Users/yumanhordijk/Downloads/FragAnal.adf.rkf')

# cub1 = orbs.sfos['1(SOMO)'].cube_file()
# cub2 = orbs.sfos['2(21A)'].cube_file()

# S = cub1.copy()
# S.values = abs(cub1.values * cub2.values)
# mol = cub1.molecule

# # T = tcutility.geometry.MolTransform(mol)
# # T.center(1) # center on C1
# # T.align_to_vector(1, 2, [1, 0, 0]) # put C=O bond on x-axis
# # T.align_to_plane(2, 1, 4, [0, 1, 0]) # place the molecule on the xz-plane
# # # T.rotate(x=7 * np.pi / 180)
# # scene.transform = T.to_vtkTransform()

# scene.draw_molecule(cub1.molecule)
# scene.draw_isosurface(S, 0.009, [0, 1, 1])
# # scene.draw_isosurface(cub2, -0.03, [1, .5, 0])
# # scene.draw_isosurface(cub2, 0.03, [0, 1, 1])

# scr.screenshots(directory='screenshots')

0 comments on commit 58ffdc0

Please sign in to comment.