Polygon

Qualified name: manim.mobject.geometry.Polygon

class Polygon(*vertices, **kwargs)[source]

Bases: manim.mobject.geometry.Polygram

A shape consisting of one closed loop of vertices.

Parameters
  • vertices (Sequence[float]) – The vertices of the Polygon.

  • kwargs – Forwarded to the parent constructor.

Examples

Example: PolygonExample

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

class PolygonExample(Scene):
    def construct(self):
        isosceles = Polygon([-5, 1.5, 0], [-2, 1.5, 0], [-3.5, -2, 0])
        position_list = [
            [4, 1, 0],  # middle right
            [4, -2.5, 0],  # bottom right
            [0, -2.5, 0],  # bottom left
            [0, 3, 0],  # top left
            [2, 1, 0],  # middle
            [4, 3, 0],  # top right
        ]
        square_and_triangles = Polygon(*position_list, color=PURPLE_B)
        self.add(isosceles, square_and_triangles)

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.