manim.mobject.svg.brace.Brace

class Brace(mobject, direction=array([0.0, - 1.0, 0.0]), buff=0.2, width_multiplier=2, max_num_quads=15, min_num_quads=0, background_stroke_width=0, **kwargs)[source]

Bases: manim.mobject.svg.tex_mobject.MathTex

Takes a mobject and draws a brace adjacent to it.

Passing a direction vector determines the direction from which the brace is drawn. By default it is drawn from below.

Parameters
  • mobject (Mobject) – The mobject adjacent to which the brace is placed.

  • direction (Optional[Union[list, numpy.array]]) – The direction from which the brace faces the mobject.

Examples

BraceExample
class BraceExample(Scene):
    def construct(self):
        circle = Circle()
        brace = Brace(circle, direction=RIGHT)
        self.play(Create(circle))
        self.play(Create(brace))
        self.wait(2)

Methods

get_direction

Uses shoelace_direction() to calculate the direction.

get_tex

get_text

get_tip

put_at_tip

Attributes

animate

Used to animate the application of a method.

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.

get_direction()[source]

Uses shoelace_direction() to calculate the direction. The direction of points determines in which direction the object is drawn, clockwise or counterclockwise.

Examples

The default direction of a Circle is counterclockwise:

>>> from manim import Circle
>>> Circle().get_direction()
'CCW'
Returns

Either "CW" or "CCW".

Return type

str