Star

Qualified name: manim.mobject.geometry.Star

class Star(n=5, *, outer_radius=1, inner_radius=None, density=2, start_angle=1.5707963267948966, **kwargs)[source]

Bases: manim.mobject.geometry.Polygon

A regular polygram without the intersecting lines.

Parameters
  • n (int) – How many points on the Star.

  • outer_radius (float) – The radius of the circle that the outer vertices are placed on.

  • inner_radius (Optional[float]) –

    The radius of the circle that the inner vertices are placed on.

    If unspecified, the inner radius will be calculated such that the edges of the Star perfectly follow the edges of its RegularPolygram counterpart.

  • density (int) –

    The density of the Star. Only used if inner_radius is unspecified.

    See RegularPolygram for more information.

  • start_angle (Optional[float]) – The angle the vertices start at; the rotation of the Star.

  • kwargs – Forwardeds to the parent constructor.

Raises

ValueError – If inner_radius is unspecified and density is not in the range [1, n/2).

Examples

Example: StarExample

../_images/StarExample-1.gif
from manim import *

class StarExample(Scene):
    def construct(self):
        pentagram = RegularPolygram(5, radius=2)
        star = Star(outer_radius=2, color=RED)

        self.add(pentagram)
        self.play(Create(star), run_time=3)
        self.play(FadeOut(star), run_time=2)

Example: DifferentDensitiesExample

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

class DifferentDensitiesExample(Scene):
    def construct(self):
        density_2 = Star(7, outer_radius=2, density=2, color=RED)
        density_3 = Star(7, outer_radius=2, density=3, color=PURPLE)

        self.add(VGroup(density_2, density_3).arrange(RIGHT))

Methods

Attributes

animate

Used to animate the application of a method.

animation_overrides

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.