nglview
nglview copied to clipboard
get ase structure from view
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.
hi @dou-du, why don't you use molecule('H2O')
directly?
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.
I see. Unfortunately, there is no direct and clean way to get the information. Let me think a bit. Cheers.