Polygon#
Qualified name: manim.mobject.geometry.polygram.Polygon
- class Polygon(*vertices, **kwargs)[source]#
Bases:
PolygramA 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 ¶
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
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.