schrodinger.graphics3d.hemisphere module

Maestro 3D hemispheres.

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

Control over the center, radius, color, resolution and opacity of a hemisphere are provided. See the Hemisphere class for more info.

To add any number of hemispheres, create the Hemisphere instance and add it to a Group instance. Hemispheres can be shown or hidden through the Group instance.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.graphics3d.hemisphere.MaestroHemisphere(center=None, color=None, direction=(0.0, 0.0, 1.0), radius=None, opacity=1.0, resolution=16, angle_dep_transparency=False)

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

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

Hemispheres 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.hemisphere as hemisphere

hemisphere_grp = common.Group()
st = maestro.workspace_get()
for at in st.atom:
    hemisph = hemisphere.MaestroHemisphere(
        center=(at.x, at.y, at.z)
        radius=1.0,
        resolution=20,
        opacity=0.8,
        color='red'
    )
    # Add the primative to the container.
    hemisphere_grp.add(hemisph)

# Unlike Hemisphere MaestroHemisphere simply needs to be shown to be
#  drawn.
# No special callback like there is for Hemispheres is needed.
hemisphere_grp.show()

# Hide the markers.
hemisphere_grp.hide()

# Remove the markers
hemisphere_grp.clear()
__init__(center=None, color=None, direction=(0.0, 0.0, 1.0), radius=None, opacity=1.0, resolution=16, angle_dep_transparency=False)

Constructor requires:

Parameters

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

color: One of:

Color object Color name (string) Tuple of (R, G, B) (each 0.0-1.0)

radius: radius of the hemisphere in Angstroms

Optional arguments:

opacity: 0.0 (transparent) through 1.0 (opaque)

Defaults to 1.0

resolution: 4 to 50

Defaults to 16

angle_dep_transparency: if true, then we modify the color of the

hemisphere based on the angle from the center

setCoords()
setXYZCoords(x, y, z)
property x

Get X coordinate

property y

Get Y coordinate

property z

Get Z coordinate

property radius

Get hemisphere’s radius in angstroms