VoltageSourceBase¶
- class manim_eng.components.base.source.VoltageSourceBase(arrow: bool, voltage: str | None = None, **kwargs: Any)¶
Bases:
SourceBase class of all voltage sources.
Attributes
VoltageSourceBase.animateUsed to animate the application of any method of
self.VoltageSourceBase.animation_overridesVoltageSourceBase.anodeReturn the anode (positive terminal) of the source.
VoltageSourceBase.cathodeReturn the cathode (negative terminal) of the source.
VoltageSourceBase.colorVoltageSourceBase.depthThe depth of the mobject.
VoltageSourceBase.fill_colorIf there are multiple colors (for gradient) this returns the first one
VoltageSourceBase.heightThe height of the mobject.
VoltageSourceBase.leftReturn the left-hand terminal of the component.
VoltageSourceBase.n_points_per_curveVoltageSourceBase.negativeReturn the negative (left-hand) terminal of the source.
VoltageSourceBase.positiveReturn the positive (right-hand) terminal of the source.
VoltageSourceBase.rightReturn the right-hand terminal of the component.
VoltageSourceBase.sheen_factorVoltageSourceBase.stroke_colorVoltageSourceBase.terminalsThe list of terminals of the component.
VoltageSourceBase.widthThe 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.