nglview.shape

Module contents

class nglview.shape.Shape(view)[source]

Bases: object

TODO: doc

view : nglview.NGLWidget

Unstable feature

>>> import nglview as nv
>>> view = nv.NGLWidget()
>>> view
>>> shape = nv.Shape(view=view)
>>> # TODO: add example
>>> shape.add_sphere(...)
add(*args)[source]
>>> view.shape.add('text', [0, 4, -1], [0.2, 0.5, 0.8], 2.5, 'Meow')

http://nglviewer.org/ngl/

add_buffer(name, **kwargs)[source]
>>> view.shape.add_buffer("cone",
...     position1=[0, 0, 0],
...     position2=[1, 1, 1],
...     color=[1, 0, 0],
...     color2=[0, 1, 0],
...     radius= [1])