RoundedRectangle#

Qualified name: manim.mobject.geometry.polygram.RoundedRectangle

class RoundedRectangle(corner_radius=0.5, **kwargs)[source]#

Bases: Rectangle

A rectangle with rounded corners.

Parameters:
  • corner_radius (float | list[float]) – The curvature of the corners of the rectangle.

  • kwargs – Additional arguments to be passed to Rectangle

Examples

Example: RoundedRectangleExample

../_images/RoundedRectangleExample-1.png
from manim import *

class RoundedRectangleExample(Scene):
    def construct(self):
        rect_1 = RoundedRectangle(corner_radius=0.5)
        rect_2 = RoundedRectangle(corner_radius=1.5, height=4.0, width=4.0)

        rect_group = Group(rect_1, rect_2).arrange(buff=1)
        self.add(rect_group)
class RoundedRectangleExample(Scene):
    def construct(self):
        rect_1 = RoundedRectangle(corner_radius=0.5)
        rect_2 = RoundedRectangle(corner_radius=1.5, height=4.0, width=4.0)

        rect_group = Group(rect_1, rect_2).arrange(buff=1)
        self.add(rect_group)

Methods

Attributes

animate

Used to animate the application of any method of self.

animation_overrides

color

depth

The depth of the mobject.

fill_color

If there are multiple colors (for gradient) this returns the first one

height

The height of the mobject.

n_points_per_curve

sheen_factor

stroke_color

width

The width of the mobject.

_original__init__(corner_radius=0.5, **kwargs)#

Initialize self. See help(type(self)) for accurate signature.

Parameters:

corner_radius (float | list[float]) –