manim.mobject.types.vectorized_mobject.CurvesAsSubmobjects

class CurvesAsSubmobjects(vmobject, **kwargs)[source]

Bases: manim.mobject.types.vectorized_mobject.VGroup

Convert a curve’s elements to submobjects.

Examples

Example: LineGradientExample

../_images/LineGradientExample-1.png
from manim import *

class LineGradientExample(Scene):
    def construct(self):
        curve = ParametricFunction(lambda t: [t, np.sin(t), 0], t_range=[-PI, PI, 0.01], stroke_width=10)
        new_curve = CurvesAsSubmobjects(curve)
        new_curve.set_color_by_gradient(BLUE, RED)
        self.add(new_curve.shift(UP), curve)

Methods

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.