Terminal¶
- class manim_eng.components.base.terminal.Terminal(position: ndarray[tuple[Any, ...], dtype[float64]], direction: ndarray[tuple[Any, ...], dtype[float64]], auto: bool = False)¶
Bases:
MarkableTerminal for a circuit component (i.e. the bit other wires connect to).
- Parameters:
position (Vector3D) – The position of the start of the terminal, i.e. the bit that ‘connects’ to the body of the component.
direction (Vector3D) – The direction the terminal ‘points’, i.e. the direction you get by walking from the point on the component body where the terminal attaches to the end of the terminal.
auto (bool) – Whether the terminal should control its visibility. When set to
True, the terminal will only be shown if there is at least one connection to it or there is a current annotation set on the terminal. When set toFalse, the terminal is displayed no matter what. This is the default.
Attributes
Terminal.animateUsed to animate the application of any method of
self.Terminal.animation_overridesTerminal.colorTerminal.depthThe depth of the mobject.
Return the direction of the terminal as a normalised vector.
Return the global position of the end of the terminal.
Terminal.fill_colorIf there are multiple colors (for gradient) this returns the first one
Terminal.heightThe height of the mobject.
Terminal.n_points_per_curveTerminal.sheen_factorTerminal.stroke_colorTerminal.widthThe width of the mobject.
- clear_current() Self¶
Clear the current annotation of the terminal.
- property direction: ndarray[tuple[Any, ...], dtype[float64]]¶
Return the direction of the terminal as a normalised vector.
- property end: ndarray[tuple[Any, ...], dtype[float64]]¶
Return the global position of the end of the terminal.
- is_visible() bool¶
Whether the terminal is currently visible on screen.
- match_style(vmobject: VMobject, _family: bool = True) Self¶
Match the style of the terminal wire to another vmobject.
- Parameters:
vmobject (VMobject) – The vmobject to match to.
_family (bool) – Disregarded in this case.
Notes
It is not possible to override the stroke width
The
_familyargument has no effect.
- reset_current(label: str | Value, out: bool = False, below: bool = False) Self¶
Set the current label of the terminal. Unspecified arguments are reset.
Sets the current label, with unspecified arguments being reset to their original (default) values. In contrast to its sister method .set_current(), this method will always produce the same result regardless of where it is called.
- Parameters:
label (str | Value) – The current label to set. Takes a TeX math mode string, or a
Valueto be typeset as a math mode string.out (bool) – Whether the arrow accompanying the annotation should point out (away from the body of the component to which the terminal is attached), or in (towards the component, this is the default).
below (bool) – Whether the annotation should be placed below the current arrow, or above it (which is the default). Note that ‘below’ here is defined as below the terminal when it is pointing right.
See also
set_currentSet the current label without resetting unspecified arguments.
- set_current(label: str | Value | None, out: bool | None = None, below: bool | None = None) Self¶
Set the current label of the terminal.
Sets the current label, with unspecified arguments being left to their current values.
- Parameters:
label (str | Value, optional) – The current label to set. Takes a TeX math mode string, or a
Valueto be typeset as a math mode string.out (bool, optional) – Whether the arrow accompanying the annotation should point out (away from the body of the component to which the terminal is attached), or in (towards the component). If unspecified, falls back to the previous setting, or if there is none, the default (
False).below (bool, optional) – Whether the annotation should be placed below the current arrow, or above it. Note that ‘below’ here is defined as below the terminal when it is pointing right. If unspecified, falls back to the previous setting, or if there is none, the default (
False).
See also
reset_currentSet the current label, with unspecified arguments being reset to default.