manim.mobject.geometry.Cutout

class Cutout(main_shape, *mobjects, **kwargs)[source]

Bases: manim.mobject.types.vectorized_mobject.VMobject

A shape with smaller cutouts.

Warning

Technically, this class behaves similar to a symmetric difference: if parts of the mobjects are not located within the main_shape, these parts will be added to the resulting VMobject.

Parameters
  • main_shape (VMobject) – The primary shape from which cutouts are made.

  • mobjects (VMobject) – The smaller shapes which are to be cut out of the main_shape.

  • kwargs – Further keyword arguments that are passed to the constructor of VMobject.

Examples

Example: CutoutExample

from manim import *

class CutoutExample(Scene):
    def construct(self):
        s1 = Square().scale(2.5)
        s2 = Triangle().shift(DOWN + RIGHT).scale(0.5)
        s3 = Square().shift(UP + RIGHT).scale(0.5)
        s4 = RegularPolygon(5).shift(DOWN + LEFT).scale(0.5)
        s5 = RegularPolygon(6).shift(UP + LEFT).scale(0.5)
        c = Cutout(s1, s2, s3, s4, s5, fill_opacity=1, color=BLUE, stroke_color=RED)
        self.play(Write(c), run_time=4)
        self.wait()

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.