schrodinger.graphics3d.arrow module¶
Maestro 3D arrows.
The arrow module allows creation and drawing of arrows. Clients draw using graphics3d.common.Group instances, aliased here as ArrowGroup, not through Arrow instances.
Control over the endpoints, radius, color, resolution and transparency of a arrow are provided. See the Arrow class for more info.
To draw any number of arrows create Arrow instances, add them to a Group instance.
Copyright Schrodinger LLC, All rights reserved.
- class schrodinger.graphics3d.arrow.MaestroArrow(xhead=None, yhead=None, zhead=None, xtail=None, ytail=None, ztail=None, color=None, r=0.0, g=1.0, b=0.0, radius=0.15, transparency=None, opacity=1.0, resolution=16, body_percentage=0.75, remove_endcaps=False)¶
Bases:
schrodinger.graphics3d.common._MaestroPrimitiveMixin
,schrodinger.graphics3d.common.Primitive
Class for creating a 3D arrow in Maestro
Arrows should be added to a Group and drawing done via the Group. See the Group documentation.
API Example:
import schrodinger.maestro.maestro as maestro import schrodinger.graphics3d.common as common import schrodinger.graphics3d.arrow as arrow arrow_grp = common.Group() st = maestro.workspace_get() for bond in st.bond: ar = arrow.MaestroArrow( xhead=bond.atom2.x, yhead=bond.atom2.y, zhead=bond.atom2.z, xtail=bond.atom1.x, ytail=bond.atom1.y, ztail=bond.atom1.z, color='red', radius=0.15, opacity=0.8, resolution=50 ) # Add the primative to the container. arrow_grp.add(ar) # Unlike Arrow MaestroArrow simply needs to be shown to be drawn. # No special callback like there is for Arrows is needed. arrow_grp.show() # Hide the markers. arrow_grp.hide() # Remove the markers and the callback. arrow_grp.clear()
- __init__(xhead=None, yhead=None, zhead=None, xtail=None, ytail=None, ztail=None, color=None, r=0.0, g=1.0, b=0.0, radius=0.15, transparency=None, opacity=1.0, resolution=16, body_percentage=0.75, remove_endcaps=False)¶
Constructor requires:
- Parameters
xhead – x coordinate of head position
yhead – y coordinate of head position
zhead – z coordinate of head position
xtail – x coordinate of tail position
ytail – y coordinate of tail position
ztail – z coordinate of tail position
color – One of Color object (Color class) or Color name (string) or Tuple of (R, G, B) (each a float in range 0.0-1.0)
radius – radius of the arrow in Angstroms Default: .15
opacity – 0.0 (invisible) through 1.0 (opaque) Default: 0.0
resolution – Ranges from ?? to ??. Default: ??
remove_endcaps – Whether to remove cylinder endcaps on arrow body.
- calculateCoords(body_percentage=0.75)¶
Calculate the intermediate coordinate between head and body
- property xhead¶
- property yhead¶
- property zhead¶
- property xtail¶
- property ytail¶
- property ztail¶
- property radius¶