Star#
Qualified name: manim.mobject.geometry.polygram.Star
- class Star(n=5, *, outer_radius=1, inner_radius=None, density=2, start_angle=1.5707963267948966, **kwargs)[source]#
Bases:
PolygonA 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 (float | None) –
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
Starperfectly follow the edges of itsRegularPolygramcounterpart.density (int) –
The density of the
Star. Only used ifinner_radiusis unspecified.See
RegularPolygramfor more information.start_angle (float | None) – The angle the vertices start at; the rotation of the
Star.kwargs – Forwardeds to the parent constructor.
- Raises
ValueError – If
inner_radiusis unspecified anddensityis not in the range[1, n/2).
Examples
Example: StarExample ¶
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 ¶
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
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.