RegularPolygon¶
Qualified name: manim.mobject.geometry.polygram.RegularPolygon
- class RegularPolygon(n=6, **kwargs)[source]¶
Bases:
RegularPolygramAn n-sided regular
Polygon.- Parameters:
n (int) – The number of sides of the
RegularPolygon.kwargs (Any) – Forwarded to the parent constructor.
Examples
Example: RegularPolygonExample ¶
from manim import * class RegularPolygonExample(Scene): def construct(self): poly_1 = RegularPolygon(n=6) poly_2 = RegularPolygon(n=6, start_angle=30*DEGREES, color=GREEN) poly_3 = RegularPolygon(n=10, color=RED) poly_group = Group(poly_1, poly_2, poly_3).scale(1.5).arrange(buff=1) self.add(poly_group)
class RegularPolygonExample(Scene): def construct(self): poly_1 = RegularPolygon(n=6) poly_2 = RegularPolygon(n=6, start_angle=30*DEGREES, color=GREEN) poly_3 = RegularPolygon(n=10, color=RED) poly_group = Group(poly_1, poly_2, poly_3).scale(1.5).arrange(buff=1) self.add(poly_group)Methods
Attributes
alwaysCall a method on a mobject every frame.
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.
- _original__init__(n=6, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
n (int)
kwargs (Any)
- Return type:
None