본문 바로가기

Programming/Manim code

[023]Rectangle, Square, RoundedRectangle

반응형

Rectangle

 

rect = Rectangle()

 

 

 

Square

square = Square()

 

 

RoundedRectangle

rect = RoundedRectangle()

 

 

corner_radius

    def round_test(self):
        values = [0.1, 0.5,1,1.5,2]

        def get_rect(val):
            rect = RoundedRectangle(corner_radius=val).scale(0.5)
            text = Text(str(val), size=0.3, stroke_width=0).next_to(rect, UP)
            return VGroup(rect,text)

        rects = VGroup(*[get_rect(v) for v in values])      
        rects.arrange(RIGHT)

        self.add(rects)
        self.wait()

 

반응형

'Programming > Manim code' 카테고리의 다른 글

[025]ArcBetweenPoints  (0) 2020.05.11
[024]Arc  (0) 2020.05.11
[022]Triangle/ArrowTip  (0) 2020.05.06
[021]Polygon  (0) 2020.05.06
[020]Vector/TangentLine  (0) 2020.05.06