TracedPath

Qualified name: manim.mobject.changing.TracedPath

class TracedPath(traced_point_func, stroke_width=2, stroke_color='#FFFFFF', dissipating_time=None, **kwargs)[source]

Bases: manim.mobject.types.vectorized_mobject.VMobject

Traces the path of a point returned by a function call.

Parameters
  • traced_point_func (Callable) – The function to be traced.

  • stroke_width (float) – The width of the trace.

  • stroke_color (colour.Color) – The color of the trace.

  • dissipating_time (Optional[float]) – The time taken for the path to dissipate. Default set to None which disables dissipation.

Examples

Example: TracedPathExample

from manim import *

class TracedPathExample(Scene):
    def construct(self):
        circ = Circle(color=RED).shift(4*LEFT)
        dot = Dot(color=RED).move_to(circ.get_start())
        rolling_circle = VGroup(circ, dot)
        trace = TracedPath(circ.get_start)
        rolling_circle.add_updater(lambda m: m.rotate(-0.3))
        self.add(trace, rolling_circle)
        self.play(rolling_circle.animate.shift(8*RIGHT), run_time=4, rate_func=linear)

Example: DissipatingPathExample

from manim import *

class DissipatingPathExample(Scene):
    def construct(self):
        a = Dot(RIGHT * 2)
        b = TracedPath(a.get_center, dissipating_time=0.5, stroke_opacity=[0, 1])
        self.add(a, b)
        self.play(a.animate(path_arc=PI / 4).shift(LEFT * 2))
        self.play(a.animate(path_arc=-PI / 4).shift(LEFT * 2))
        self.wait()

Methods

update_path

Attributes

animate

Used to animate the application of a method.

animation_overrides

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.