Pencil animations

class manim_extensions.compass.MovePencilTipTo(pencil, point=None, **kwargs)[source]

Bases: ApplyMethod

Move the pencil so that its nib is placed at point.

Example: MovePencilTipToDocExample

from manim import *
from manim_extensions.compass import Pencil, MovePencilTipTo

class MovePencilTipToDocExample(Scene):
    def construct(self):
        pencil = Pencil().to_edge(LEFT)
        self.play(MovePencilTipTo(pencil, ORIGIN))
        self.wait()
from manim import *
from manim_extensions.compass import Pencil, MovePencilTipTo

class MovePencilTipToDocExample(Scene):
    def construct(self):
        pencil = Pencil().to_edge(LEFT)
        self.play(MovePencilTipTo(pencil, ORIGIN))
        self.wait()

__init__(pencil, point=None, **kwargs)[source]

Move the pencil so that its nib is placed at point.

Parameters:
  • pencil (Pencil) – The pencil.

  • point (Point) – The target point.

class manim_extensions.compass.PutPencilAway(pencil, point=None, **kwargs)[source]

Bases: MovePencilTipTo

Put the pencil away: move the pencil to point.

Example: PutPencilAwayDocExample

from manim import *
from manim_extensions.compass import Pencil, PutPencilAway

class PutPencilAwayDocExample(Scene):
    def construct(self):
        pencil = Pencil().to_edge(LEFT)
        self.play(PutPencilAway(pencil, 2 * DOWN))
        self.wait()
from manim import *
from manim_extensions.compass import Pencil, PutPencilAway

class PutPencilAwayDocExample(Scene):
    def construct(self):
        pencil = Pencil().to_edge(LEFT)
        self.play(PutPencilAway(pencil, 2 * DOWN))
        self.wait()

__init__(pencil, point=None, **kwargs)[source]

Put the pencil away: move the pencil to point.

Parameters:
  • pencil (Pencil) – The pencil.

  • point (Point) – The placement position.

class manim_extensions.compass.MovePencilAlongPath(mobject, path=None, suspend_mobject_updating=False, **kwargs)[source]

Bases: MoveAlongPath

Animation of the pencil nib moving along a given path.

Example: MovePencilAlongPathDocExample

from manim import *
from manim_extensions.compass import Pencil, MovePencilAlongPath

class MovePencilAlongPathDocExample(Scene):
    def construct(self):
        pencil = Pencil().to_edge(LEFT)
        path = Line(LEFT, RIGHT)
        self.play(MovePencilAlongPath(pencil, path))
        self.wait()
from manim import *
from manim_extensions.compass import Pencil, MovePencilAlongPath

class MovePencilAlongPathDocExample(Scene):
    def construct(self):
        pencil = Pencil().to_edge(LEFT)
        path = Line(LEFT, RIGHT)
        self.play(MovePencilAlongPath(pencil, path))
        self.wait()

__init__(mobject, path=None, suspend_mobject_updating=False, **kwargs)[source]

Move the pencil along the given path, using the nib as the reference point.

Parameters:
  • mobject (Pencil) – The pencil.

  • path (VMobject) – The target path.

  • suspend_mobject_updating (Optional[bool]) – Whether to suspend mobject updating.

class manim_extensions.compass.DrawPath(pencil, path=None, **kwargs)[source]

Bases: AnimationGroup

Animation of the pencil nib moving along the path while drawing it.

Example: DrawPathDocExample

from manim import *
from manim_extensions.compass import Pencil, DrawPath

class DrawPathDocExample(Scene):
    def construct(self):
        pencil = Pencil().to_edge(LEFT)
        path = Line(LEFT, RIGHT)
        self.play(DrawPath(pencil, path))
        self.wait()
from manim import *
from manim_extensions.compass import Pencil, DrawPath

class DrawPathDocExample(Scene):
    def construct(self):
        pencil = Pencil().to_edge(LEFT)
        path = Line(LEFT, RIGHT)
        self.play(DrawPath(pencil, path))
        self.wait()

__init__(pencil, path=None, **kwargs)[source]

Animation of the pencil nib moving along the path while drawing it.

Parameters: