A community-maintained Python framework for creating mathematical animations.
Improve Arrow Tip Showcase example in docstring of class ArrowTip (#3297)
John Lynch658f1b4b3a0a
diff --git a/manim/mobject/geometry/tips.py b/manim/mobject/geometry/tips.pyindex 39d802b47..e002c89b4 100644--- a/manim/mobject/geometry/tips.py+++ b/manim/mobject/geometry/tips.py@@ -76,23 +76,34 @@ class ArrowTip(VMobject, metaclass=ConvertToOpenGL):.. manim:: ArrowTipsShowcase:save_last_frame:- from manim.mobject.geometry.tips import ArrowTriangleTip,\- ArrowSquareTip, ArrowSquareFilledTip,\- ArrowCircleTip, ArrowCircleFilledTipclass ArrowTipsShowcase(Scene):def construct(self):- a00 = Arrow(start=[-2, 3, 0], end=[2, 3, 0], color=YELLOW)- a11 = Arrow(start=[-2, 2, 0], end=[2, 2, 0], tip_shape=ArrowTriangleTip)- a12 = Arrow(start=[-2, 1, 0], end=[2, 1, 0])- a21 = Arrow(start=[-2, 0, 0], end=[2, 0, 0], tip_shape=ArrowSquareTip)- a22 = Arrow([-2, -1, 0], [2, -1, 0], tip_shape=ArrowSquareFilledTip)- a31 = Arrow([-2, -2, 0], [2, -2, 0], tip_shape=ArrowCircleTip)- a32 = Arrow([-2, -3, 0], [2, -3, 0], tip_shape=ArrowCircleFilledTip)- b11 = a11.copy().scale(0.5, scale_tips=True).next_to(a11, RIGHT)- b12 = a12.copy().scale(0.5, scale_tips=True).next_to(a12, RIGHT)- b21 = a21.copy().scale(0.5, scale_tips=True).next_to(a21, RIGHT)- self.add(a00, a11, a12, a21, a22, a31, a32, b11, b12, b21)-+ tip_names = [+ 'Default (YELLOW)', 'ArrowTriangleTip', 'Default', 'ArrowSquareTip',+ 'ArrowSquareFilledTip', 'ArrowCircleTip', 'ArrowCircleFilledTip', 'StealthTip'+ ]++ big_arrows = [+ Arrow(start=[-4, 3.5, 0], end=[2, 3.5, 0], color=YELLOW),+ Arrow(start=[-4, 2.5, 0], end=[2, 2.5, 0], tip_shape=ArrowTriangleTip),+ Arrow(start=[-4, 1.5, 0], end=[2, 1.5, 0]),+ Arrow(start=[-4, 0.5, 0], end=[2, 0.5, 0], tip_shape=ArrowSquareTip),++ Arrow([-4, -0.5, 0], [2, -0.5, 0], tip_shape=ArrowSquareFilledTip),+ Arrow([-4, -1.5, 0], [2, -1.5, 0], tip_shape=ArrowCircleTip),+ Arrow([-4, -2.5, 0], [2, -2.5, 0], tip_shape=ArrowCircleFilledTip),+ Arrow([-4, -3.5, 0], [2, -3.5, 0], tip_shape=StealthTip)+ ]++ small_arrows = (+ arrow.copy().scale(0.5, scale_tips=True).next_to(arrow, RIGHT) for arrow in big_arrows+ )++ labels = (+ Text(tip_names[i], font='monospace', font_size=20, color=BLUE).next_to(big_arrows[i], LEFT) for i in range(len(big_arrows))+ )++ self.add(*big_arrows, *small_arrows, *labels)"""def __init__(self, *args, **kwargs):