manim.mobject.geometry.RegularPolygon

class RegularPolygon(n=6, **kwargs)[source]

Bases: manim.mobject.geometry.RegularPolygram

An n-sided regular Polygon.

Parameters
  • n (int) – The number of sides of the RegularPolygon.

  • kwargs – Forwarded to the parent constructor.

Examples

Example: RegularPolygonExample

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

class RegularPolygonExample(Scene):
    def construct(self):
        poly_1 = RegularPolygon(n=6)
        poly_2 = RegularPolygon(n=6, start_angle=30*DEGREES, color=GREEN)
        poly_3 = RegularPolygon(n=10, color=RED)

        poly_group = Group(poly_1, poly_2, poly_3).scale(1.5).arrange(buff=1)
        self.add(poly_group)

Methods

Attributes

animate

Used to animate the application of a method.

animation_overrides

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.