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

get ase structure from view #911

Open
dou-du opened this issue Jul 1, 2020 · 3 comments
Open

get ase structure from view #911

dou-du opened this issue Jul 1, 2020 · 3 comments

Comments

@dou-du
Copy link

dou-du commented Jul 1, 2020

I am wondering it is possible to get molecular structure or coordinates easily from view.
For example:

from ase.build import molecule
import nglview as nv

view = nv.show_ase(molecule('H2O'))

Now, how can I get elements and coordinates information back from view ?
I see that view.get_state() contains the elements and coordinates information. But it is
not easy to use. Is there any other good way to do it ? Thanks.

@hainm
Copy link
Collaborator

hainm commented Jul 1, 2020

hi @dou-du, why don't you use molecule('H2O') directly?

@dou-du
Copy link
Author

dou-du commented Jul 1, 2020

hi @hainm
Actually, I want to write function to render high quality image by using Pov-Ray. I am thinking about to integrate it with Nglview.
For instance, call it by view.render_by_povray(). I would also like to make pull request for this function. So, I need the elements and their coordinates. Thanks.

@hainm
Copy link
Collaborator

hainm commented Jul 1, 2020

I see. Unfortunately, there is no direct and clean way to get the information. Let me think a bit. Cheers.

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