MCPcopy
hub / github.com/ManimCommunity/manim / construct

Method construct

example_scenes/basic.py:134–161  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

132
133class SpiralInExample(Scene):
134 def construct(self):
135 logo_green = "#81b29a"
136 logo_blue = "#454866"
137 logo_red = "#e07a5f"
138
139 font_color = "#ece6e2"
140
141 pi = MathTex(r"\pi").scale(7).set_color(font_color)
142 pi.shift(2.25 * LEFT + 1.5 * UP)
143
144 circle = Circle(color=logo_green, fill_opacity=0.7, stroke_width=0).shift(LEFT)
145 square = Square(color=logo_blue, fill_opacity=0.8, stroke_width=0).shift(UP)
146 triangle = Triangle(color=logo_red, fill_opacity=0.9, stroke_width=0).shift(
147 RIGHT
148 )
149 pentagon = Polygon(
150 *[
151 [np.cos(2 * np.pi / 5 * i), np.sin(2 * np.pi / 5 * i), 0]
152 for i in range(5)
153 ],
154 color=PURPLE_B,
155 fill_opacity=1,
156 stroke_width=0,
157 ).shift(UP + 2 * RIGHT)
158 shapes = VGroup(triangle, square, circle, pentagon, pi)
159 self.play(SpiralIn(shapes, fade_in_fraction=0.9))
160 self.wait()
161 self.play(FadeOut(shapes))
162
163
164Triangle.set_default(stroke_width=20)

Callers

nothing calls this directly

Calls 13

MathTexClass · 0.85
CircleClass · 0.85
SquareClass · 0.85
TriangleClass · 0.85
VGroupClass · 0.85
SpiralInClass · 0.85
FadeOutClass · 0.85
waitMethod · 0.80
PolygonClass · 0.50
set_colorMethod · 0.45
scaleMethod · 0.45
shiftMethod · 0.45

Tested by

no test coverage detected