BipoleSwitchBase¶
- class manim_eng.components.base.switch.BipoleSwitchBase(closed: bool = False, **kwargs: Any)¶
Bases:
BipoleBase class for switches with two terminals.
Note that subclasses should construct their switch models open.
Attributes
BipoleSwitchBase.animateUsed to animate the application of any method of
self.BipoleSwitchBase.animation_overridesBipoleSwitchBase.colorBipoleSwitchBase.depthThe depth of the mobject.
BipoleSwitchBase.fill_colorIf there are multiple colors (for gradient) this returns the first one
BipoleSwitchBase.heightThe height of the mobject.
BipoleSwitchBase.leftReturn the left-hand terminal of the component.
BipoleSwitchBase.n_points_per_curveBipoleSwitchBase.rightReturn the right-hand terminal of the component.
BipoleSwitchBase.sheen_factorBipoleSwitchBase.stroke_colorBipoleSwitchBase.terminalsThe list of terminals of the component.
BipoleSwitchBase.widthThe 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 baseComponentclass 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).