A community-maintained Python framework for creating mathematical animations.
Uniformisation of the examples names, but ... facing an issue
MysaaJavacbbad120f917
diff --git a/docs/source/examples/3d.rst b/docs/source/examples/3d.rstindex 0964a4604..de902adc8 100644--- a/docs/source/examples/3d.rst+++ b/docs/source/examples/3d.rst@@ -1,10 +1,10 @@3D Scenes=================================-.. manim:: Example3DNo1+.. manim:: ThreeDSphereExample:save_last_frame:- class Example3DNo1(ThreeDScene):+ class ThreeDSphereExample(ThreeDScene):def construct(self):axes = ThreeDAxes()sphere = ParametricSurface(@@ -18,10 +18,10 @@self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)self.add(axes, sphere)-.. manim:: Example3DLightSourcePosition+.. manim:: ThreeDLightSourcePositionExample:save_last_frame:- class Example3DLightSourcePosition(ThreeDScene):+ class ThreeDLightSourcePositionExample(ThreeDScene):def construct(self):axes = ThreeDAxes()sphere = ParametricSurface(@@ -36,9 +36,9 @@self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)self.add(axes, sphere)-.. manim:: Example3DNo3+.. manim:: ThreeDCameraRotationExample- class Example3DNo3(ThreeDScene):+ class ThreeDCameraRotationExample(ThreeDScene):def construct(self):axes = ThreeDAxes()circle=Circle()@@ -50,9 +50,9 @@self.move_camera(phi=75 * DEGREES, theta=30 * DEGREES)self.wait()-.. manim:: Example3DNo4+.. manim:: ThreeDCameraIllusionRotationExample- class Example3DNo4(ThreeDScene):+ class ThreeDCameraIllusionRotationExample(ThreeDScene):def construct(self):axes = ThreeDAxes()circle=Circle()@@ -62,10 +62,10 @@self.wait(PI)self.stop_3dillusion_camera_rotation()-.. manim:: Example3DNo5+.. manim:: ThreeDParametricSpringExample:save_last_frame:- class Example3DNo5(ThreeDScene):+ class ThreeDParametricSpringExample(ThreeDScene):def construct(self):curve1 = ParametricFunction(lambda u: np.array([@@ -79,9 +79,9 @@self.set_camera_orientation(phi=80 * DEGREES, theta=-60 * DEGREES)self.wait()-.. manim:: ThreeDPlane+.. manim:: ThreeDFunctionExample- class ThreeDPlane(ThreeDScene):+ class ThreeDFunctionExample(ThreeDScene):def construct(self):diff --git a/docs/source/examples/animations.rst b/docs/source/examples/animations.rstindex 9e35b39e8..2121afdcf 100644--- a/docs/source/examples/animations.rst+++ b/docs/source/examples/animations.rst@@ -10,9 +10,9 @@ Some more examples will come soon here!Updaters##########-.. manim:: Updater1Example+.. manim:: RotationUpdaterExample- class Updater1Example(Scene):+ class RotationUpdaterExample(Scene):def construct(self):def my_rotation_updater(mobj,dt):mobj.rotate_about_origin(dt)@@ -22,9 +22,9 @@ Updatersself.add(line_reference, line_moving)self.wait(PI)-.. manim:: Updater2Example+.. manim:: RotationUpdater2Example- class Updater2Example(Scene):+ class RotationUpdater2Example(Scene):def construct(self):def updater_forth(mobj, dt):mobj.rotate_about_origin(dt)@@ -41,9 +41,9 @@ Updatersline_moving.remove_updater(updater_back)self.wait(0.5)-.. manim:: Example3+.. manim:: NumberLinePointerExample- class Example3(Scene):+ class NumberLinePointerExample(Scene):def construct(self):number_line = NumberLine() ##with all your parameters and stuffpointer = Vector(DOWN)@@ -57,10 +57,11 @@ Updatersself.play(pointer_value.set_value, 5)self.wait()self.play(pointer_value.set_value, 3)+ self.wait()-.. manim:: Example4+.. manim:: SnakeExample- class Example4(Scene):+ class SnakeExample(Scene):def construct(self):path = VMobject()dot = Dot()@@ -77,9 +78,9 @@ Updatersself.play(dot.shift, LEFT)self.wait()-.. manim:: Example1ValTracker+.. manim:: ValTracker1Example- class Example1ValTracker(Scene):+ class ValTracker1Example(Scene):def construct(self):dot_disp = Dot().set_color(RED)self.add(dot_disp)@@ -92,9 +93,9 @@ Updatersself.play(val_tracker.set_value, tick_end, rate_func=linear)self.wait()-.. manim:: Example2ValTracker+.. manim:: ValTracker2Example- class Example2ValTracker(Scene):+ class ValTracker2Example(Scene):def construct(self):tick_start = 0tick_end = 2 * PI@@ -107,9 +108,9 @@ Updatersself.add(line_reference, line_moving)self.play(val_tracker.set_value, tick_end, run_time=PI)-.. manim:: PlaneFadeOut+.. manim:: PlaneFadeOutExample- class PlaneFadeOut(Scene):+ class PlaneFadeOutExample(Scene):def construct(self):@@ -130,9 +131,9 @@ Updatersself.play(FadeOut(sq1),FadeOut(sq2),FadeOut(sq3))self.wait()-.. manim:: AnimationFadeInAndOut+.. manim:: FadeInAndOutExample- class AnimationFadeInAndOut(Scene):+ class FadeInAndOutExample(Scene):def construct(self):square = Square(color=BLUE).shift(2*UP)diff --git a/docs/source/examples/shapes_images_positions.rst b/docs/source/examples/shapes_images_positions.rstindex 8db7a3092..736260bec 100644--- a/docs/source/examples/shapes_images_positions.rst+++ b/docs/source/examples/shapes_images_positions.rst@@ -1,7 +1,7 @@Shapes, Images and Positions=================================-.. manim:: Example1Shape+.. manim:: GeometricShapesExample:save_last_frame:class Example1Shape(Scene):@@ -17,7 +17,30 @@ Shapes, Images and Positionsself.wait(1)-.. manim:: Example1ImageFromArray+.. manim:: ShapesExample++ class ShapesExample(Scene):++ def construct(self):++ circle = Circle(radius= 1, color=BLUE)++ dot = Dot()+ dot2= dot.copy().shift(RIGHT)+ self.add(dot)++ line=Line(np.array([3,0,0]),np.array([5,0,0]))+ self.add(line)+++ self.play(GrowFromCenter(circle))+ self.play(Transform(dot,dot2))+ self.play(MoveAlongPath(dot,circle), run_time= 2, rate_func=linear)+ self.play(Rotating(dot, about_point=np.array((2, 0, 0.))), run_time=1.5)+ self.wait()+++.. manim:: ImageFromArrayExample:save_last_frame:class Example1ImageFromArray(Scene):@@ -28,7 +51,20 @@ Shapes, Images and Positionsself.add(image)-.. manim:: Example2ImageFromFile+.. manim:: GradientImageFromArrayExample+ :save_last_frame:++ class ImageFromGradient(Scene):+ def construct(self):+ n = 256+ imageArray = np.uint8([[i*256/n for i in range(0,n)] for j in range(0,n)])+ image = ImageMobject(imageArray).scale(2)+ image.next_to(ORIGIN,LEFT, SMALL_BUFF)+ self.add(image)+ self.wait(1)+++.. manim:: ImageFromFileExample:save_last_frame:class Example2ImageFromFile(Scene):@@ -63,42 +99,6 @@ Shapes, Images and Positionsself.wait(2)-.. manim:: ImageFromGradient- :save_last_frame:-- class ImageFromGradient(Scene):- def construct(self):- n = 256- imageArray = np.uint8([[i*256/n for i in range(0,n)] for j in range(0,n)])- image = ImageMobject(imageArray).scale(2)- image.next_to(ORIGIN,LEFT, SMALL_BUFF)- self.add(image)- self.wait(1)---.. manim:: ShapesExample-- class ShapesExample(Scene):-- def construct(self):-- circle = Circle(radius= 1, color=BLUE)-- dot = Dot()- dot2= dot.copy().shift(RIGHT)- self.add(dot)-- line=Line(np.array([3,0,0]),np.array([5,0,0]))- self.add(line)--- self.play(GrowFromCenter(circle))- self.play(Transform(dot,dot2))- self.play(MoveAlongPath(dot,circle), run_time= 2, rate_func=linear)- self.play(Rotating(dot, about_point=np.array((2, 0, 0.))), run_time=1.5)- self.wait()--.. manim:: InterpolationExample:save_last_frame: