PushSwitchBase

class manim_eng.components.base.switch.PushSwitchBase(push_to_make: float, closed: bool, **kwargs: Any)

Bases: BipoleSwitchBase

Circuit symbol for a basic push switch.

The switch can be push-to-make or push-to-break.

Parameters:
  • push_to_make (bool) – Whether the switch should be push-to-make or push-to-break. True produces a push-to-make, False produces a push-to-break.

  • closed (bool) – Whether the switch should be initially closed or not.

Attributes

PushSwitchBase.animate

Used to animate the application of any method of self.

PushSwitchBase.animation_overrides

PushSwitchBase.color

PushSwitchBase.depth

The depth of the mobject.

PushSwitchBase.fill_color

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

PushSwitchBase.height

The height of the mobject.

PushSwitchBase.left

Return the left-hand terminal of the component.

PushSwitchBase.n_points_per_curve

PushSwitchBase.right

Return the right-hand terminal of the component.

PushSwitchBase.sheen_factor

PushSwitchBase.stroke_color

PushSwitchBase.terminals

The list of terminals of the component.

PushSwitchBase.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.

close() Self

Close the switch, if not already closed.

open() Self

Open the switch, if not already open.