Repository: ManimCommunity/manim
File: manim/mobject/geometry.py (Python)

Code before:
        Additional arguments to be passed to :class:`.~VMobject`

    Examples
    --------

    .. manim:: PolygonExample
        :save_last_frame:

        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)
    """

    def __init__(self, *vertices, color=BLUE, **kwargs):
        super().__init__(color=color, **kwargs)
        self.vertices = vertices
        self.set_points_as_corners([*vertices, vertices[0]])

    def get_vertices(self):
        """Gets the vertices of the polygon.

        Examples
        --------
        ::

            >>> sq = Square()
            >>> points = sq.get_vertices()
            >>> points
            array([[ 1.,  1.,  0.],
                   [-1.,  1.,  0.],
                   [-1., -1.,  0.],
                   [ 1., -1.,  0.]])

        Returns
        -------
        :class:`numpy.ndarray`
            Returns a list of the coordinates of polygon's vertices.
        """

        return self.get_start_anchors()


Review comment (suggestion):
This attribute is unnecessary and may cause confusion with `get_vertices` and will become outdated if the shape changes
```suggestion
```

Code after:
        The vertices of the mobject. The first one is repeated to close the shape. Must define 3-dimensions: ``[x,y,z]``
    color : :class:`~.Colors`, optional
        The color of the polygon.
    kwargs : Any
        Additional arguments to be passed to :class:`.~VMobject`

    Examples
    --------

    .. manim:: PolygonExample
        :save_last_frame:

        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)
    """

    def __init__(self, *vertices, color=BLUE, **kwargs):
        super().__init__(color=color, **kwargs)
        self.set_points_as_corners([*vertices, vertices[0]])

    def get_vertices(self):
        """Gets the vertices of the polygon.

        Examples
        --------
        ::

            >>> sq = Square()
            >>> points = sq.get_vertices()
            >>> points
            array([[ 1.,  1.,  0.],
                   [-1.,  1.,  0.],
                   [-1., -1.,  0.],
                   [ 1., -1.,  0.]])

        Returns
        -------
        :class:`numpy.ndarray`
            Returns a list of the coordinates of polygon's vertices.
        """