@@ -76,23 +76,34 @@ class ArrowTip(VMobject, metaclass=ConvertToOpenGL):
7676 .. manim:: ArrowTipsShowcase
7777 :save_last_frame:
7878
79- from manim.mobject.geometry.tips import ArrowTriangleTip,\
80- ArrowSquareTip, ArrowSquareFilledTip,\
81- ArrowCircleTip, ArrowCircleFilledTip
8279 class ArrowTipsShowcase(Scene):
8380 def construct(self):
84- a00 = Arrow(start=[-2, 3, 0], end=[2, 3, 0], color=YELLOW)
85- a11 = Arrow(start=[-2, 2, 0], end=[2, 2, 0], tip_shape=ArrowTriangleTip)
86- a12 = Arrow(start=[-2, 1, 0], end=[2, 1, 0])
87- a21 = Arrow(start=[-2, 0, 0], end=[2, 0, 0], tip_shape=ArrowSquareTip)
88- a22 = Arrow([-2, -1, 0], [2, -1, 0], tip_shape=ArrowSquareFilledTip)
89- a31 = Arrow([-2, -2, 0], [2, -2, 0], tip_shape=ArrowCircleTip)
90- a32 = Arrow([-2, -3, 0], [2, -3, 0], tip_shape=ArrowCircleFilledTip)
91- b11 = a11.copy().scale(0.5, scale_tips=True).next_to(a11, RIGHT)
92- b12 = a12.copy().scale(0.5, scale_tips=True).next_to(a12, RIGHT)
93- b21 = a21.copy().scale(0.5, scale_tips=True).next_to(a21, RIGHT)
94- self.add(a00, a11, a12, a21, a22, a31, a32, b11, b12, b21)
95-
81+ tip_names = [
82+ 'Default (YELLOW)', 'ArrowTriangleTip', 'Default', 'ArrowSquareTip',
83+ 'ArrowSquareFilledTip', 'ArrowCircleTip', 'ArrowCircleFilledTip', 'StealthTip'
84+ ]
85+
86+ big_arrows = [
87+ Arrow(start=[-4, 3.5, 0], end=[2, 3.5, 0], color=YELLOW),
88+ Arrow(start=[-4, 2.5, 0], end=[2, 2.5, 0], tip_shape=ArrowTriangleTip),
89+ Arrow(start=[-4, 1.5, 0], end=[2, 1.5, 0]),
90+ Arrow(start=[-4, 0.5, 0], end=[2, 0.5, 0], tip_shape=ArrowSquareTip),
91+
92+ Arrow([-4, -0.5, 0], [2, -0.5, 0], tip_shape=ArrowSquareFilledTip),
93+ Arrow([-4, -1.5, 0], [2, -1.5, 0], tip_shape=ArrowCircleTip),
94+ Arrow([-4, -2.5, 0], [2, -2.5, 0], tip_shape=ArrowCircleFilledTip),
95+ Arrow([-4, -3.5, 0], [2, -3.5, 0], tip_shape=StealthTip)
96+ ]
97+
98+ small_arrows = (
99+ arrow.copy().scale(0.5, scale_tips=True).next_to(arrow, RIGHT) for arrow in big_arrows
100+ )
101+
102+ labels = (
103+ Text(tip_names[i], font='monospace', font_size=20, color=BLUE).next_to(big_arrows[i], LEFT) for i in range(len(big_arrows))
104+ )
105+
106+ self.add(*big_arrows, *small_arrows, *labels)
96107 """
97108
98109 def __init__ (self , * args , ** kwargs ):
0 commit comments