Terminal

class manim_eng.components.base.terminal.Terminal(position: ndarray[tuple[Any, ...], dtype[float64]], direction: ndarray[tuple[Any, ...], dtype[float64]], auto: bool = False)

Bases: Markable

Terminal 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 to False, the terminal is displayed no matter what. This is the default.

Attributes

Terminal.animate

Used to animate the application of any method of self.

Terminal.animation_overrides

Terminal.color

Terminal.depth

The depth of the mobject.

Terminal.direction

Return the direction of the terminal as a normalised vector.

Terminal.end

Return the global position of the end of the terminal.

Terminal.fill_color

If there are multiple colors (for gradient) this returns the first one

Terminal.height

The height of the mobject.

Terminal.n_points_per_curve

Terminal.sheen_factor

Terminal.stroke_color

Terminal.width

The 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 _family argument 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 Value to 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_current

Set 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 Value to 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_current

Set the current label, with unspecified arguments being reset to default.