ArcBrace¶
Qualified name: manim.mobject.svg.brace.ArcBrace
- class ArcBrace(arc=None, direction=array([1., 0., 0.]), **kwargs)[source]¶
Bases:
BraceCreates a
Bracethat wraps around anArc.The direction parameter allows the brace to be applied from outside or inside the arc.
Warning
The
ArcBraceis smaller for arcs with smaller radii.Note
The
ArcBraceis initially a verticalBracedefined by the length of theArc, but is scaled down to match the start and end angles. An exponential function is then applied after it is shifted based on the radius of the arc.The scaling effect is not applied for arcs with radii smaller than 1 to prevent over-scaling.
- Parameters:
arc (Arc | None) – The
Arcthat wraps around theBracemobject.direction (Vector3DLike) – The direction from which the brace faces the arc.
LEFTfor inside the arc, andRIGHTfor the outside.kwargs (Any)
Example
Example: ArcBraceExample ¶
from manim import * class ArcBraceExample(Scene): def construct(self): arc_1 = Arc(radius=1.5,start_angle=0,angle=2*PI/3).set_color(RED) brace_1 = ArcBrace(arc_1,LEFT) group_1 = VGroup(arc_1,brace_1) arc_2 = Arc(radius=3,start_angle=0,angle=5*PI/6).set_color(YELLOW) brace_2 = ArcBrace(arc_2) group_2 = VGroup(arc_2,brace_2) arc_3 = Arc(radius=0.5,start_angle=-0,angle=PI).set_color(BLUE) brace_3 = ArcBrace(arc_3) group_3 = VGroup(arc_3,brace_3) arc_4 = Arc(radius=0.2,start_angle=0,angle=3*PI/2).set_color(GREEN) brace_4 = ArcBrace(arc_4) group_4 = VGroup(arc_4,brace_4) arc_group = VGroup(group_1, group_2, group_3, group_4).arrange_in_grid(buff=1.5) self.add(arc_group.center())
class ArcBraceExample(Scene): def construct(self): arc_1 = Arc(radius=1.5,start_angle=0,angle=2*PI/3).set_color(RED) brace_1 = ArcBrace(arc_1,LEFT) group_1 = VGroup(arc_1,brace_1) arc_2 = Arc(radius=3,start_angle=0,angle=5*PI/6).set_color(YELLOW) brace_2 = ArcBrace(arc_2) group_2 = VGroup(arc_2,brace_2) arc_3 = Arc(radius=0.5,start_angle=-0,angle=PI).set_color(BLUE) brace_3 = ArcBrace(arc_3) group_3 = VGroup(arc_3,brace_3) arc_4 = Arc(radius=0.2,start_angle=0,angle=3*PI/2).set_color(GREEN) brace_4 = ArcBrace(arc_4) group_4 = VGroup(arc_4,brace_4) arc_group = VGroup(group_1, group_2, group_3, group_4).arrange_in_grid(buff=1.5) self.add(arc_group.center())References:
ArcMethods
Attributes
alwaysCall a method on a mobject every frame.
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.
- _original__init__(arc=None, direction=array([1., 0., 0.]), **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
arc (Arc | None)
direction (Vector3DLike)
kwargs (Any)