Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualizing arrows defined by atoms positions along a trajectory #1105

Open
dpasserone opened this issue Apr 4, 2024 · 1 comment
Open

Comments

@dpasserone
Copy link

dpasserone commented Apr 4, 2024

I am able to add arrows to an ASEstructure object, by connecting two atoms at positions c1 and c2.

  def view_structure(structure,myvec=[]):
          t = nv.ASEStructure(structure)
          w = nv.NGLWidget(t, gui=True)
          return w
       
  myview = view_structure(myase_structure)
  c1 = myase_structure.get_positions()[6]
  c2 = myase_structure.get_positions()[5]
  myview.shape.add_arrow(c1,c2,[0,0,0],0.3)
image

How can I do the same with the analogous ASETrajectory, making the arrow recalculating the c1 and c2 positions everytime I change the frame in the GUI?

def view_trajectory(trajectory):
    t2 = nv.ASETrajectory(trajectory)
    w2 = nv.NGLWidget(t2, gui=True)
    return w2;

Thank you!

@hainm
Copy link
Collaborator

hainm commented Apr 5, 2024

hi @dpasserone
Unfortunately I don't know the answer yet (not sure if it's possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants