BipoleSwitchBase

class manim_eng.components.base.switch.BipoleSwitchBase(closed: bool = False, **kwargs: Any)

Bases: Bipole

Base class for switches with two terminals.

Note that subclasses should construct their switch models open.

Attributes

BipoleSwitchBase.animate

Used to animate the application of any method of self.

BipoleSwitchBase.animation_overrides

BipoleSwitchBase.color

BipoleSwitchBase.depth

The depth of the mobject.

BipoleSwitchBase.fill_color

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

BipoleSwitchBase.height

The height of the mobject.

BipoleSwitchBase.left

Return the left-hand terminal of the component.

BipoleSwitchBase.n_points_per_curve

BipoleSwitchBase.right

Return the right-hand terminal of the component.

BipoleSwitchBase.sheen_factor

BipoleSwitchBase.stroke_color

BipoleSwitchBase.terminals

The list of terminals of the component.

BipoleSwitchBase.width

The width of the mobject.

_construct() None

Construct the shape of the component.

Code to build the component’s symbol goes in here and not in __init__() (contrary to Manim’s standard). This is because the base Component class has to perform initialisation both before (to set up the groups etc.) and after (to set the anchor positions for annotations) the component’s shape setup.

abstractmethod close() Self

Close the switch, if not already closed.

abstractmethod open() Self

Open the switch, if not already open.

set_closed(closed: bool) Self

Set the position of the switch.

toggle() Self

Toggle the switch position (open becomes closed, closed becomes open).