Add cylinders#

Adding custom 3D geometric cylinders between spatial points to NGLView widgets.

The function molsysmt.third_party.nglview.add_cylinders() renders geometric cylinder shapes between pairs of 3D coordinates on an active NGLWidget view.

Added in version 1.0.0.

Basic usage#

Let’s demonstrate how to use this function on an interactive NGLView view:

import molsysmt as msm

molsys = msm.convert(msm.systems['T4 lysozyme L99A']['181l.h5msm'], to_form='molsysmt.MolSys')
view = msm.convert(molsys, to_form='nglview.NGLWidget')
msm.third_party.nglview.add_cylinders(view, bottom='atom_index==0', top='atom_index==10', color='#2ECC71', radius='0.4 angstroms')

Evaluating the view object displays the interactive visualization:

view