manim-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +104 -0
  2. package/dist/demo.mp4 +0 -0
  3. package/dist/index.js +65 -0
  4. package/dist/mcp-app.html +142 -0
  5. package/dist/server.js +1492 -0
  6. package/package.json +67 -0
  7. package/references/composer/SKILL.md +154 -0
  8. package/references/composer/references/3b1b-series-patterns.md +217 -0
  9. package/references/composer/references/domain-planning-guides/calculus-planning.md +188 -0
  10. package/references/composer/references/domain-planning-guides/linear-algebra-planning.md +169 -0
  11. package/references/composer/references/domain-planning-guides/ml-planning.md +286 -0
  12. package/references/composer/references/domain-planning-guides/number-theory-planning.md +187 -0
  13. package/references/composer/references/domain-planning-guides/physics-planning.md +249 -0
  14. package/references/composer/references/domain-planning-guides/probability-planning.md +200 -0
  15. package/references/composer/references/mathematical-storytelling.md +359 -0
  16. package/references/composer/references/narrative-patterns.md +221 -0
  17. package/references/composer/references/opening-patterns.md +284 -0
  18. package/references/composer/references/pacing-guide.md +289 -0
  19. package/references/composer/references/scene-archetypes.md +534 -0
  20. package/references/composer/references/scene-examples.md +379 -0
  21. package/references/composer/references/visual-techniques.md +480 -0
  22. package/references/composer/templates/scenes-template.md +147 -0
  23. package/references/manimce/SKILL.md +166 -0
  24. package/references/manimce/examples/3d_visualization.py +373 -0
  25. package/references/manimce/examples/basic_animations.py +212 -0
  26. package/references/manimce/examples/graph_plotting.py +401 -0
  27. package/references/manimce/examples/lorenz_attractor.py +172 -0
  28. package/references/manimce/examples/math_visualization.py +315 -0
  29. package/references/manimce/examples/updater_patterns.py +369 -0
  30. package/references/manimce/rules/3b1b-translation.md +594 -0
  31. package/references/manimce/rules/3d.md +254 -0
  32. package/references/manimce/rules/advanced-animations.md +594 -0
  33. package/references/manimce/rules/animation-groups.md +212 -0
  34. package/references/manimce/rules/animations.md +128 -0
  35. package/references/manimce/rules/api-pitfalls.md +89 -0
  36. package/references/manimce/rules/axes.md +214 -0
  37. package/references/manimce/rules/camera.md +208 -0
  38. package/references/manimce/rules/cli.md +232 -0
  39. package/references/manimce/rules/color-conventions.md +444 -0
  40. package/references/manimce/rules/colors.md +199 -0
  41. package/references/manimce/rules/config.md +264 -0
  42. package/references/manimce/rules/creation-animations.md +158 -0
  43. package/references/manimce/rules/graphing.md +233 -0
  44. package/references/manimce/rules/grouping.md +220 -0
  45. package/references/manimce/rules/latex.md +202 -0
  46. package/references/manimce/rules/lines.md +241 -0
  47. package/references/manimce/rules/long-form-video.md +552 -0
  48. package/references/manimce/rules/mathematical-domains.md +689 -0
  49. package/references/manimce/rules/mobjects.md +116 -0
  50. package/references/manimce/rules/multi-scene-composition.md +112 -0
  51. package/references/manimce/rules/pedagogy.md +532 -0
  52. package/references/manimce/rules/physics-simulations.md +610 -0
  53. package/references/manimce/rules/positioning.md +211 -0
  54. package/references/manimce/rules/scenes.md +121 -0
  55. package/references/manimce/rules/shapes.md +300 -0
  56. package/references/manimce/rules/styling.md +177 -0
  57. package/references/manimce/rules/text-animations.md +222 -0
  58. package/references/manimce/rules/text.md +189 -0
  59. package/references/manimce/rules/timing.md +227 -0
  60. package/references/manimce/rules/transform-animations.md +157 -0
  61. package/references/manimce/rules/updaters.md +226 -0
  62. package/references/manimce/templates/basic_scene.py +64 -0
  63. package/references/manimce/templates/camera_scene.py +100 -0
  64. package/references/manimce/templates/threed_scene.py +138 -0
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: mobjects
3
+ description: Mobject types, VMobject, and the mobject hierarchy in Manim
4
+ metadata:
5
+ tags: mobject, vmobject, group, submobjects, hierarchy
6
+ ---
7
+
8
+ # Mobjects in Manim
9
+
10
+ Mobject (Mathematical Object) is the base class for all displayable objects in Manim.
11
+
12
+ ## Mobject Hierarchy
13
+
14
+ ```
15
+ Mobject (base class)
16
+ ├── VMobject (Vectorized Mobject - most common)
17
+ │ ├── Circle, Square, Rectangle, Polygon
18
+ │ ├── Line, Arrow, Vector
19
+ │ ├── Text, MathTex, Tex
20
+ │ ├── Axes, NumberPlane
21
+ │ └── VGroup
22
+ ├── ImageMobject (for images)
23
+ ├── PMobject (point clouds)
24
+ └── Group (for non-VMobject collections)
25
+ ```
26
+
27
+ ## VMobject (Vectorized Mobject)
28
+
29
+ Most shapes you'll use are VMobjects - they're defined by Bézier curves.
30
+
31
+ ```python
32
+ # Common VMobjects
33
+ circle = Circle()
34
+ square = Square()
35
+ rect = Rectangle(width=4, height=2)
36
+ triangle = Triangle()
37
+ polygon = Polygon(ORIGIN, RIGHT, UP)
38
+ line = Line(LEFT, RIGHT)
39
+ arrow = Arrow(LEFT, RIGHT)
40
+ ```
41
+
42
+ ## Creating Custom VMobjects
43
+
44
+ ```python
45
+ class CustomShape(VMobject):
46
+ def __init__(self, **kwargs):
47
+ super().__init__(**kwargs)
48
+ # Define points using set_points_as_corners or set_points_smoothly
49
+ self.set_points_as_corners([
50
+ LEFT, UP, RIGHT, DOWN, LEFT
51
+ ])
52
+ ```
53
+
54
+ ## Mobject Properties
55
+
56
+ ### Position and Size
57
+
58
+ ```python
59
+ mobject.get_center() # Returns center point
60
+ mobject.get_width() # Returns width
61
+ mobject.get_height() # Returns height
62
+ mobject.get_top() # Top edge center point
63
+ mobject.get_bottom() # Bottom edge center point
64
+ mobject.get_left() # Left edge center point
65
+ mobject.get_right() # Right edge center point
66
+ ```
67
+
68
+ ### Bounding Box Corners
69
+
70
+ ```python
71
+ mobject.get_corner(UL) # Upper left corner
72
+ mobject.get_corner(UR) # Upper right corner
73
+ mobject.get_corner(DL) # Lower left corner
74
+ mobject.get_corner(DR) # Lower right corner
75
+ ```
76
+
77
+ ## Submobjects
78
+
79
+ Mobjects can contain other mobjects as submobjects.
80
+
81
+ ```python
82
+ # Access submobjects
83
+ group = VGroup(Circle(), Square())
84
+ group.submobjects # List of child mobjects
85
+ group[0] # First submobject (Circle)
86
+ group[1] # Second submobject (Square)
87
+
88
+ # Iterate over submobjects
89
+ for mob in group:
90
+ mob.set_color(RED)
91
+ ```
92
+
93
+ ## Copying Mobjects
94
+
95
+ ```python
96
+ # Create a copy
97
+ circle_copy = circle.copy()
98
+
99
+ # Copy and position
100
+ circle_copy = circle.copy().shift(RIGHT * 2)
101
+ ```
102
+
103
+ ## Method Chaining
104
+
105
+ Most mobject methods return `self`, allowing method chaining:
106
+
107
+ ```python
108
+ circle = Circle().set_color(RED).shift(LEFT).scale(2)
109
+ ```
110
+
111
+ ## Best Practices
112
+
113
+ 1. **Use VMobject for custom shapes** - Better rendering and animation support
114
+ 2. **Prefer VGroup over Group** - VGroup works better with most animations
115
+ 3. **Use copy() when reusing** - Avoid unintended modifications to original
116
+ 4. **Chain methods for readability** - But break into lines if too long
@@ -0,0 +1,112 @@
1
+ # Multi-Scene Composition
2
+
3
+ ## The Golden Rule
4
+
5
+ **Each scene must look visually different from every other scene.** If a viewer paused at a random frame in scene 1 and a random frame in scene 2, they should be able to tell them apart instantly.
6
+
7
+ ## Why This Matters
8
+
9
+ Each scene renders independently — no shared state, blank canvas each time. The #1 mistake is rebuilding the same base visual (e.g., a labeled triangle) in every scene, creating repetitive content.
10
+
11
+ ## Scene Planning Checklist
12
+
13
+ Before writing code, verify each scene has:
14
+ - [ ] A **different primary visual** (not the same object rebuilt)
15
+ - [ ] A **different layout** (centered vs. split-screen vs. corner)
16
+ - [ ] A **different purpose** in the argument (introduce → prove → apply)
17
+
18
+ ## Patterns That Work
19
+
20
+ ### Progressive Revelation (Best for Proofs)
21
+ ```
22
+ Scene 1: Pose the question with a concrete example
23
+ → Visual: animated scenario that creates curiosity
24
+ Scene 2: Show the KEY INSIGHT (the "aha" moment)
25
+ → Visual: geometric proof, rearrangement, or transformation
26
+ Scene 3: Formalize and verify
27
+ → Visual: equation derivation + numerical check
28
+ ```
29
+
30
+ ### Concrete → Abstract → Application
31
+ ```
32
+ Scene 1: Specific example with numbers (3-4-5 triangle)
33
+ Scene 2: General principle with variables (a² + b² = c²)
34
+ Scene 3: Surprising application (distance formula, dot product)
35
+ ```
36
+
37
+ ### Multiple Perspectives
38
+ ```
39
+ Scene 1: Algebraic view (equations, computations)
40
+ Scene 2: Geometric view (shapes, areas, transformations)
41
+ Scene 3: Synthesis (both views together, showing equivalence)
42
+ ```
43
+
44
+ ## Anti-Patterns — DO NOT DO THESE
45
+
46
+ ### Repeated Base Visual
47
+ ```python
48
+ # BAD — Scene 1
49
+ triangle = Polygon(A, B, C)
50
+ a_label = MathTex("a")
51
+ b_label = MathTex("b")
52
+ c_label = MathTex("c")
53
+ self.play(Create(triangle), Write(a_label), Write(b_label), Write(c_label))
54
+
55
+ # BAD — Scene 2 rebuilds the SAME thing
56
+ triangle = Polygon(A, B, C) # Same triangle again!
57
+ a_label = MathTex("a") # Same labels again!
58
+ ```
59
+
60
+ ### Fix: Make Each Scene Visually Distinct
61
+ ```python
62
+ # GOOD — Scene 1: Question + concrete example
63
+ title = Text("Can we predict the longest side?")
64
+ triangle_345 = Polygon(...) # Specific 3-4-5 triangle with numbers
65
+ self.play(Write(title))
66
+ self.play(Create(triangle_345))
67
+
68
+ # GOOD — Scene 2: Geometric proof (completely different visual)
69
+ # Four copies of the triangle arranged in a square
70
+ big_square = Square(side_length=5)
71
+ triangles = VGroup(*[Polygon(...).rotate(i * PI/2) for i in range(4)])
72
+ inner_square = Square(...) # The c² square in the middle
73
+ self.play(Create(big_square), LaggedStartMap(Create, triangles))
74
+
75
+ # GOOD — Scene 3: The equation + verification
76
+ equation = MathTex("a^2", "+", "b^2", "=", "c^2", font_size=72)
77
+ # Show multiple examples: 3-4-5, 5-12-13, 8-15-17
78
+ examples = VGroup(...)
79
+ ```
80
+
81
+ ### Slow Rebuilds
82
+ ```python
83
+ # BAD — spending 10 seconds rebuilding what the viewer just saw
84
+ with self.voiceover(text="Recall our triangle..."):
85
+ self.play(Create(triangle), run_time=3) # Viewer already saw this!
86
+ self.play(Write(a_label), Write(b_label), Write(c_label), run_time=3)
87
+ ```
88
+
89
+ ### Fix: Brief Recap
90
+ ```python
91
+ # GOOD — tiny reference in corner, 1-2 seconds max
92
+ small_triangle = triangle_copy.scale(0.3).to_corner(UL)
93
+ self.play(FadeIn(small_triangle), run_time=0.5)
94
+ # Then focus on the NEW content
95
+ ```
96
+
97
+ ## Layout Variety
98
+
99
+ Vary where content appears across scenes:
100
+
101
+ | Scene | Layout | Example |
102
+ |-------|--------|---------|
103
+ | 1 | Centered, full stage | Big animated diagram |
104
+ | 2 | Split left/right | Proof on left, annotation on right |
105
+ | 3 | Top equation + bottom visual | Formula above, verification below |
106
+
107
+ ## Visual Identity Per Scene
108
+
109
+ Give each scene a distinct visual signature:
110
+ - **Scene 1**: Warm colors (RED, ORANGE, YELLOW) — the "question"
111
+ - **Scene 2**: Cool colors (BLUE, GREEN, TEAL) — the "insight"
112
+ - **Scene 3**: Mixed/gold (GOLD, WHITE) — the "conclusion"