Union

Qualified name: manim.mobject.boolean\_ops.Union

class Union(*vmobjects, **kwargs)[source]

Bases: manim.mobject.boolean_ops._BooleanOps

Union of two or more VMobject s. This returns the common region of the VMobject s.

Parameters

vmobjects (manim.mobject.types.vectorized_mobject.VMobject) – The VMobject s to find the union of.

Raises

ValueError – If less than 2 VMobject s are passed.

Return type

None

Example

Example: UnionExample

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

class UnionExample(Scene):
    def construct(self):
        sq = Square(color=RED, fill_opacity=1)
        sq.move_to([-2, 0, 0])
        cr = Circle(color=BLUE, fill_opacity=1)
        cr.move_to([-1.3, 0.7, 0])
        un = Union(sq, cr, color=GREEN, fill_opacity=1)
        un.move_to([1.5, 0.3, 0])
        self.add(sq, cr, un)

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.