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

../_images/LineGradientExample-1.png
LineGradientExample
class LineGradientExample(Scene):
    def construct(self):
        curve = ParametricFunction(lambda t: [t, np.sin(t), 0], t_min = -PI, t_max=PI,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.