VoltageSourceBase

class manim_eng.components.base.source.VoltageSourceBase(arrow: bool, voltage: str | None = None, **kwargs: Any)

Bases: Source

Base class of all voltage sources.

Attributes

VoltageSourceBase.animate

Used to animate the application of any method of self.

VoltageSourceBase.animation_overrides

VoltageSourceBase.anode

Return the anode (positive terminal) of the source.

VoltageSourceBase.cathode

Return the cathode (negative terminal) of the source.

VoltageSourceBase.color

VoltageSourceBase.depth

The depth of the mobject.

VoltageSourceBase.fill_color

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

VoltageSourceBase.height

The height of the mobject.

VoltageSourceBase.left

Return the left-hand terminal of the component.

VoltageSourceBase.n_points_per_curve

VoltageSourceBase.negative

Return the negative (left-hand) terminal of the source.

VoltageSourceBase.positive

Return the positive (right-hand) terminal of the source.

VoltageSourceBase.right

Return the right-hand terminal of the component.

VoltageSourceBase.sheen_factor

VoltageSourceBase.stroke_color

VoltageSourceBase.terminals

The list of terminals of the component.

VoltageSourceBase.width

The width of the mobject.

clear_voltage() Self

Clear the voltage label of the source.

Clears the voltage label of the source (i.e. the label of the component). For non-arrowed (American-style) sources there is no difference between using this and using .clear_label(), however for European sources the arrow is removed only when calling this method. For portability between source types it is therefore recommended to use this method over .clear_label().

set_voltage(voltage: str) Self

Set the voltage of the source.

Sets the voltage label of the source, using the label of the component to do so. For non-arrowed (American-style) sources there is no difference between using this and using .set_label(), however for arrowed sources an arrow is added only when calling this method. For portability between source types it is therefore recommended to use this method over .set_label().

Parameters:

voltage (str) – The voltage label to set. Takes a TeX math mode string.