Monopole

class manim_eng.components.base.monopole.Monopole(direction: ndarray[tuple[Any, ...], dtype[float64]], **kwargs: Any)

Bases: Component

Base class for monopole components, such as grounds and rails.

Creates a single terminal in the direction of direction with its start at the origin.

Parameters:

direction (Vector3D) – The direction the terminal of the component should face.

Attributes

Monopole.animate

Used to animate the application of any method of self.

Monopole.animation_overrides

Monopole.color

Monopole.depth

The depth of the mobject.

Monopole.fill_color

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

Monopole.height

The height of the mobject.

Monopole.n_points_per_curve

Monopole.sheen_factor

Monopole.stroke_color

Monopole.terminal

Get the terminal of the component.

Monopole.terminals

The list of terminals of the component.

Monopole.width

The width of the mobject.

align_monopole(other: Terminal | ndarray[tuple[Any, ...], dtype[float64]] | Node | Monopole, direction: ndarray[tuple[Any, ...], dtype[float64]] | None = None) Self

Aligns the monopole’s terminal with another point or component.

Moves this component along the line perpendicular to direction such that the line between the end of this component’s terminal and other has direction vector direction.

Parameters:
  • other (Terminal | Point3D | Node | Monopole) – A Terminal belonging to another component, a Node, a Monopole (for which its single terminal is selected), or a point in space.

  • direction (Vector3D | None) – The direction to align the terminals in. If not supplied, uses self_terminal’s direction.

Raises:

ValueError – If other belongs to this component (if it is a Terminal) or if other is this component (if it is a Node or Monopole).

Notes

In geometric terms, the component in moved such that the end of this monopole’s terminal is at the intersection of the lines that

  • Have direction vector perpendicular to direction and go through the

    current position of the end of this monopole’s terminal; and

  • Have direction vector direction and go through the end of

    other (in the case that it is a Terminal) or through other (in the case that it is a point).

clear_annotation() Self

Fails for monopoles, as they do not have annotations.

set_annotation(annotation: str | Value) Self

Fails for monopoles, as they do not have annotations.

property terminal: Terminal

Get the terminal of the component.