Skip to content

Commit 2289376

Browse files
authored
Merge #445: New sections for the sphinx-example page
2 parents 88a3f63 + 955c6dd commit 2289376

File tree

12 files changed

+144
-68
lines changed

12 files changed

+144
-68
lines changed

docs/source/examples.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ Examples
22
============
33

44
.. toctree::
5-
:caption: Table of Contents
65

7-
examples/hello_example
8-
examples/plots_examples
6+
examples/shapes
7+
examples/annotations
8+
examples/plots
9+
examples/text
10+
examples/formulas
11+
examples/3d
12+
examples/camera_settings
13+
examples/animations
14+
examples/neat_projects
15+
examples/advanced_projects

docs/source/examples/3d.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
3D Scenes
2+
=================================
3+
4+
.. manim:: Example3DNo1
5+
:quality: medium
6+
:save_last_frame:
7+
8+
class Example3DNo1(ThreeDScene):
9+
def construct(self):
10+
axes = ThreeDAxes()
11+
sphere = ParametricSurface(
12+
lambda u, v: np.array([
13+
1.5 * np.cos(u) * np.cos(v),
14+
1.5 * np.cos(u) * np.sin(v),
15+
1.5 * np.sin(u)
16+
]), v_min=0, v_max=TAU, u_min=-PI / 2, u_max=PI / 2,
17+
checkerboard_colors=[RED_D, RED_E], resolution=(15, 32)
18+
)
19+
self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
20+
self.add(axes, sphere)
21+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Advanced Projects
2+
=================================
3+
4+
This page is currently under construction. It will feature a selection of advanced projects built with manim.

docs/source/examples/animations.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Animations
2+
============
3+
4+
5+
Transformations
6+
#################
7+
8+
Some more examples will come soon here!
9+
10+
Updaters
11+
##########
12+
13+
.. manim:: Updater1Example
14+
:quality: medium
15+
16+
class Updater1Example(Scene):
17+
def construct(self):
18+
curve_reference = Line(ORIGIN, LEFT).set_color(GREEN)
19+
self.add(curve_reference)
20+
21+
def update_curve(mob, dt):
22+
mob.rotate_about_origin(dt)
23+
24+
curve2 = Line(ORIGIN, LEFT)
25+
curve2.add_updater(update_curve)
26+
self.add(curve_reference, curve2)
27+
self.wait(PI)

docs/source/examples/annotations.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Annotations
2+
=================================
3+
4+
.. manim:: AnnotateBrace
5+
:quality: medium
6+
:save_last_frame:
7+
8+
class AnnotateBrace(Scene):
9+
def construct(self):
10+
dot = Dot([0, 0, 0])
11+
dot2 = Dot([2, 1, 0])
12+
line = Line(dot.get_center(), dot2.get_center()).set_color(ORANGE)
13+
b1 = Brace(line)
14+
b1text = b1.get_text("Distance")
15+
b2 = Brace(line, direction=line.copy().rotate(PI / 2).get_unit_vector())
16+
b2text = b2.get_tex("x-x_1")
17+
self.add(dot, dot2, line, b1, b2, b1text, b2text)
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Camera Settings
2+
=================================
3+
4+
.. manim:: TestZoom1
5+
:quality: medium
6+
7+
class TestZoom1(ZoomedScene):
8+
CONFIG = {
9+
"zoomed_camera_frame_starting_position": [0, 0, 0],
10+
"zoomed_display_corner": [0, 0, 0],
11+
"zoomed_display_height": config['frame_height'],
12+
"zoomed_display_width": config['frame_width'],
13+
"zoom_factor": 0.1,
14+
}
15+
def construct(self):
16+
self.activate_zooming(animate=True)
17+
d = Dot()
18+
self.add(d)

docs/source/examples/formulas.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Formulas
2+
=================================
3+
4+
.. manim:: Formula1
5+
:quality: medium
6+
:save_last_frame:
7+
8+
class Formula1(Scene):
9+
def construct(self):
10+
t = MathTex(r"\int_a^b f'(x) dx = f(b)- f(a)")
11+
self.add(t)
12+
self.wait(1)

docs/source/examples/hello_example.rst

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
NeatProjects
2+
=================================
3+
4+
This page is currently under construction. It will feature a selection of neat projects built with manim.
File renamed without changes.

0 commit comments

Comments
 (0)