anim.plane.ellipse¶
- class anim.plane.ellipse(Lx=None, Ly=None, dimension=None, color='grey', stroke=None, thickness=0, linestyle='-', group=None, x=0, y=0, position=None, center_of_rotation=[0, 0], orientation=0, zvalue=0, draggable=False, clickable=False)¶
An ellipse item is defined by its:
dimensions (major and minor axis length, named here a and b respectively)
position of the point of reference
orientation of the major axis
styling
Parameters ══════════
- name
str The ellipse’s name
- group
anim.plane.group default: None The ellipse’s group. If None, the position of the reference point and center of rotation are in absolute coordinates. Otherwise, the position is relative to the group’s reference point.
─── dimensions ──────────────────────────────
- Lx
float The ellipse’s width, i.e. length along the x axis when orientation is 0.
- Ly
float The ellipse’s height, i.e.length along the y axis when orientation is 0.
- dimension
(float, float), [float, float], complex default: [0,0] Dimensions along the x and y axes when orientation is 0. The user must define either Lx, Ly or the dimension array. In case of conflicting definitions, the dimension attribute wins.
─── position ────────────────────────────────
- x
float default: 0 x-position of the reference point.
- y
float default: 0 y-position of the reference point.
- position
(float, float), [float, float], complex default: [0,0] Position of the reference point. The user can define either x, y or the position. In case of conflict, the position attribute wins.
─── transformations ─────────────────────────
- orientation
float default: 0, unit: radians Orientation of the ellipse, with respect to the positive part of the x-axis.
- center_of_rotation
(float, float), [float, float], complex default: None Center point for the rotation.
- draggable
bool default: False Boolean specifying if the item can be dragged. If True, the dragging callback is defined in the ‘itemChange’ method of the event class, which is transfered to the canva’s ‘event’ method (recommended).
─── stack ───────────────────────────────────
- zvalue
float default: 0 Z-value (stack order) of the ellipse.
─── style ────────────────────────────────
- color
None, str, QColor default: ‘grey’ Fill color. None stands for transparency.
- stroke
None, str, QColor default: None Stroke color. None stands for transparency.
- thickness
float default: 0 Stroke thickness, in scene units. When it is equal to 0, the stroke has the minimal thickness of 1 pixel.
- linestyle
‘solid’/’-’, ‘dash’/’–’, ‘dot’/’..’/’:’, ‘dashdot’/’-.’ default: ‘-’ Stroke style.
- __init__(Lx=None, Ly=None, dimension=None, color='grey', stroke=None, thickness=0, linestyle='-', group=None, x=0, y=0, position=None, center_of_rotation=[0, 0], orientation=0, zvalue=0, draggable=False, clickable=False)¶
Ellipse item constructor
Methods
__init__([Lx, Ly, dimension, color, stroke, ...])Ellipse item constructor
initialize()Initialize the ellipse
rotate(angle)Relative rotation
setColor()Color styling
setGeometry()Set the ellipse's geometry
setOrientation()Set the qitem orientation
setPosition([position])Sets the qitem's position.
setStroke()Stroke styling
translate(dx[, dy])Relative translation
Attributes
LxLycenter_of_rotationclickablecolordimensiondraggablegrouplinestyleorientationpositionstrokethicknessxyzvalue