Bipole

class manim_eng.components.base.bipole.Bipole(left: Terminal | None = None, right: Terminal | None = None, **kwargs: Any)

Bases: Component

Base class for bipole components, such as resistors and sources.

By default, adds two terminals: one from (-0.5, 0) to (-1, 0), and one from (0.5, 0) to (1, 0).

Parameters:
  • left (Terminal | None) – The terminal to use as the left connection point for the component. If left unspecified, the terminal will be in the default position for the left terminal of a rectangular bipole.

  • right (Terminal | None) – The terminal to use as the right connection point for the component. If left unspecified, the terminal will be in the default position for the right terminal of a rectangular bipole.

Attributes

Bipole.animate

Used to animate the application of any method of self.

Bipole.animation_overrides

Bipole.color

Bipole.depth

The depth of the mobject.

Bipole.fill_color

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

Bipole.height

The height of the mobject.

Bipole.left

Return the left-hand terminal of the component.

Bipole.n_points_per_curve

Bipole.right

Return the right-hand terminal of the component.

Bipole.sheen_factor

Bipole.stroke_color

Bipole.terminals

The list of terminals of the component.

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

property left: Terminal

Return the left-hand terminal of the component.

Note that ‘left’ here is defined as when the component is unrotated. This does not adapt to rotation.

property right: Terminal

Return the right-hand terminal of the component.

Note that ‘right’ here is defined as when the component is unrotated. This does not adapt to rotation.