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

Code before:
    """

    def __init__(self, *vertices, color=BLUE, **kwargs):
        VMobject.__init__(self, color=color, **kwargs)
        # There are actually four corners, and the first one is repeated twice to form the four vertices.
        self.set_points_as_corners([*vertices, vertices[0]])

    def get_vertices(self):
        """Get the vertices of a given polygon.

        Examples
        --------

        ::

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

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

        return self.get_start_anchors()

    def round_corners(self, radius=0.5):
        """Rounds off the corners of a polygon.

        Parameters
        ----------
        radius : :class:`float`, optional
            The curvature of the corners of the rectangle.

        Examples
        --------

        .. manim:: PolygonRoundCorners
            :save_as_gif:

            class PolygonRoundCorners(Scene):
                def construct(self):
                    points = [[-4, -2, 0], [-2, 2, 0], [4, 2, 0], [2, -2, 0]]
                    parallelogram = Polygon(*points, stroke_color=LIGHT_PINK)
                    curved = Polygon(*points, stroke_color=LIGHT_PINK).round_corners(radius=0.5)
                    curved_more = Polygon(*points, stroke_color=LIGHT_PINK).round_corners(radius=1.5)

Review comment (suggestion):
np.array is a method, np.ndarray is the class. Also, when referring to packages outside of manim, use the full package name to be explicit (i.e. numpy and not np)
```suggestion
        :class:`numpy.ndarray`
```

Code after:
            Returns a list of the coordinates of polygon's vertices.
        """

        return self.get_start_anchors()

    def round_corners(self, radius=0.5):
        """Rounds off the corners of the polygon.

        Parameters
        ----------
        radius : :class:`float`, optional
            The curvature of the corners of the polygon.

        Examples
        --------

        .. manim:: PolygonRoundCorners
            :save_as_gif:

            class PolygonRoundCorners(Scene):
                def construct(self):
                    points = [[-4, -2, 0], [-2, 2, 0], [4, 2, 0], [2, -2, 0]]
                    parallelogram = Polygon(*points, stroke_color=LIGHT_PINK)
                    rounded_1 = Polygon(*points, stroke_color=LIGHT_PINK).round_corners(radius=0.5)
                    rounded_2 = Polygon(*points, stroke_color=LIGHT_PINK).round_corners(radius=1.5)

                    self.play(Transform(parallelogram, rounded_1))
                    self.wait(0.5)
                    self.play(Transform(parallelogram, rounded_2))
                    self.wait(0.5)

        See Also
        --------
        :class:`RoundedRectangle`
        """

        vertices = self.get_vertices()
        arcs = []
        for v1, v2, v3 in adjacent_n_tuples(vertices, 3):
            vect1 = v2 - v1
            vect2 = v3 - v2
            unit_vect1 = normalize(vect1)
            unit_vect2 = normalize(vect2)
            angle = angle_between_vectors(vect1, vect2)
            # Negative radius gives concave curves
            angle *= np.sign(radius)
            # Distance between vertex and start of the arc
            cut_off_length = radius * np.tan(angle / 2)
            # Determines counterclockwise vs. clockwise
            sign = np.sign(np.cross(vect1, vect2)[2])
            arc = ArcBetweenPoints(