Polygon

class Polygon(*points: Point, plane, **kwargs)[source]

A polygon is a closed PolygonalChain.

Examples

Example: PolygonExample

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

from hmanim.native import Point, Polygon

class PolygonExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the polygon.
        polygon = Polygon(
            *[
                Point(3.0, 0.0),
                Point(4.0, TAU / 4),
                Point(2.0, TAU / 2),
                Point(1.0, TAU * 3 / 4),
            ],
            plane=plane
        )
        self.add(polygon)
from hmanim.native import Point, Polygon

class PolygonExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the polygon.
        polygon = Polygon(
            *[
                Point(3.0, 0.0),
                Point(4.0, TAU / 4),
                Point(2.0, TAU / 2),
                Point(1.0, TAU * 3 / 4),
            ],
            plane=plane
        )
        self.add(polygon)

copy() Polygon[source]

Create and return an identical copy of the Mobject including all submobjects.

Returns:

The copy.

Return type:

Mobject

Note

The clone is initially not visible in the Scene, even if the original was.