schrodinger.graphics3d.ellipsoid module

Maestro 3D ellipsoid.

The ellipsoid module allows creation of ellipsoids. Clients add ellipsoids to Group instances, and Maesto draws them.

Control over the center, principal axes, and color of the ellipsoid are provided.

To add any number of ellipsoids, create the Ellipsoid instance and add it to a Group instance. Ellipsoids can be shown or hidden through the Group instance.

Note that this mechanism works for small numbers of ellipsoids (on the order of 10 or so). If we need significantly more ellipsoids than that, we will need to provide an array interface.

class schrodinger.graphics3d.ellipsoid.MaestroEllipsoid(center, r1_axis, r2_axis, r3_axis, color)

Bases: schrodinger.graphics3d.common._MaestroPrimitiveMixin, schrodinger.graphics3d.common.Primitive

Class to create a 3D ellipsoid in Maestro. This ellipsoid will be drawn at the appropriate time in Maestro to interact properly with transparent objects.

Ellipsoids should be added to a Group and drawing done via the Group. See Group documentation.

API Example:

import schrodinger.maestro.maestro as maestro
import schrodinger.graphics3d.common as common
import schrodinger.graphics3d.ellipsoid as ellipsoid

ellipsoid_grp = common.Group()
st = maestro.workspace_get()
for at in st.atom:
    ellips = ellipsoid.MaestroEllipsoid(
        center=(at.x, at.y, at.z)
        r1_axis=(1.0, 0.0, 0.0),
        r2_axis=(0.0, 0.5, 0.0),
        r3_axis=(0.0, 0.0, 1.0),
        color=(1.0, 0.0, 0.0, 1.0)
    )
    # Add the primitive to the container.
    ellipsoid_grp.add(ellips)

# Unlike Ellipsoid, MaestroEllipsoid simply needs to be shown to be
#  drawn.
# No special callback like there is for Ellipsoids is needed.
ellipsoid_grp.show()

# Hide the markers.
ellipsoid_grp.hide()

# Remove the markers
ellipsoid_grp.clear()
__init__(center, r1_axis, r2_axis, r3_axis, color)

Constructor requires:

Parameters
  • center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the ellipsoid.

  • r1_axis – List of 3 Angstrom values indicating one of the principal axes of the ellipsoid. None of the axes can be all zeros.

  • r2_axis – List of 3 Angstrom values indicating one of the principal axes of the ellipsoid. None of the axes can be all zeros.

  • r3_axis – List of 3 Angstrom values indicating one of the principal axes of the ellipsoid. None of the axes can be all zeros.

  • color (list(float, float, float, float)) – The RGBA color of the ellipsoid. All components must be in the range 0.0 to 1.0.

setXYZCoords(x, y, z)
property x

Get X coordinate

property y

Get Y coordinate

property z

Get Z coordinate