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,379 @@
1
+ # Scene Examples
2
+
3
+ Example scene breakdowns from 3b1b-style videos, derived from actual video source code (2015-2026).
4
+
5
+ ---
6
+
7
+ ## Example 1: Explaining the Dot Product (EoLA Ch 9)
8
+
9
+ ### Scene 1: The Question
10
+ **Duration**: ~30 seconds
11
+ **Purpose**: Hook the viewer with the mystery
12
+
13
+ **Visual Elements**
14
+ - Two vectors a and b drawn as arrows
15
+ - The dot product formula: a . b = |a||b|cos(theta)
16
+ - Question mark animation
17
+
18
+ **Content**
19
+ Open on two vectors. Show the formula. Pose the question: "Why does multiplying components and adding them give you something related to the angle between vectors?"
20
+
21
+ **Narration Notes**
22
+ Tone: curious, slightly puzzled. Emphasize that the formula seems arbitrary.
23
+
24
+ **Technical Notes**
25
+ - Use Arrow for vectors
26
+ - Tex for formula with `t2c` for color-coded variables
27
+ - `Indicate()` on the cos(theta) term
28
+
29
+ ---
30
+
31
+ ### Scene 2: Geometric Interpretation
32
+ **Duration**: ~90 seconds
33
+ **Purpose**: Show projection interpretation
34
+
35
+ **Visual Elements**
36
+ - Vector a (horizontal, GREEN -- basis vector convention)
37
+ - Vector b (angled, YELLOW)
38
+ - Projection of b onto a (dashed line)
39
+ - Right angle marker
40
+ - Length labels
41
+
42
+ **Content**
43
+ Show that a . b equals |a| times the projection of b onto a. Animate the projection dropping down. Show this equals |a||b|cos(theta) geometrically.
44
+
45
+ **Narration Notes**
46
+ "The dot product measures how much one vector goes in the direction of another."
47
+
48
+ **Technical Notes**
49
+ - DashedLine for projection
50
+ - RightAngle mobject
51
+ - `animate.rotate()` for showing different angles
52
+
53
+ ---
54
+
55
+ ### Scene 3: Numeric Connection
56
+ **Duration**: ~60 seconds
57
+ **Purpose**: Connect geometry to algebra (Two Perspectives -> Unity)
58
+
59
+ **Visual Elements**
60
+ - Coordinate grid
61
+ - Vector a = [a1, a2] with GREEN column coloring
62
+ - Vector b = [b1, b2] with YELLOW coloring
63
+ - Components highlighted
64
+
65
+ **Content**
66
+ Show vectors on grid with components labeled. Demonstrate why a1*b1 + a2*b2 equals the geometric interpretation. Use specific numbers (e.g., a=[2,1], b=[1,3]).
67
+
68
+ **Narration Notes**
69
+ Walk through calculation slowly. "Let's see why the algebra matches the geometry."
70
+
71
+ **Technical Notes**
72
+ - NumberPlane or Axes
73
+ - Brace for component labels
74
+ - TransformMatchingTex for equation steps
75
+
76
+ ---
77
+
78
+ ## Example 2: Introduction to Fourier Series (DiffEq Part 4)
79
+
80
+ ### Scene 1: The Hook (Result Preview Pattern)
81
+ **Duration**: ~45 seconds
82
+ **Purpose**: Show the surprising result
83
+
84
+ **Visual Elements**
85
+ - A square wave (sharp corners)
86
+ - Sum of smooth sine waves
87
+ - Morphing animation between them
88
+
89
+ **Content**
90
+ "You can build a square wave -- something with sharp corners -- from perfectly smooth sine waves." Show the result first, then promise to explain how.
91
+
92
+ **Narration Notes**
93
+ Tone: wonder, slight disbelief. This should feel surprising.
94
+
95
+ **Technical Notes**
96
+ - ParametricFunction for waves
97
+ - Transform animation for the morph
98
+ - Consider showing 1, 3, 5 terms building up (Progressive Build pattern)
99
+
100
+ ---
101
+
102
+ ### Scene 2: Building Blocks
103
+ **Duration**: ~120 seconds
104
+ **Purpose**: Introduce sine waves as basis
105
+
106
+ **Visual Elements**
107
+ - Single sine wave
108
+ - Frequency visualization (faster oscillation)
109
+ - Amplitude visualization (taller/shorter)
110
+ - Phase visualization (shifting left/right)
111
+
112
+ **Content**
113
+ Introduce the three parameters: frequency, amplitude, phase. Show each one separately, then combine.
114
+
115
+ **Narration Notes**
116
+ Go slow. "A sine wave has three knobs we can adjust..."
117
+
118
+ **Technical Notes**
119
+ - ValueTracker for animating parameters
120
+ - Updaters to make wave respond to trackers
121
+ - Labels for each parameter
122
+
123
+ ---
124
+
125
+ ### Scene 3: Superposition
126
+ **Duration**: ~90 seconds
127
+ **Purpose**: Show waves can be added
128
+
129
+ **Visual Elements**
130
+ - Two sine waves (different colors)
131
+ - Their sum (third color)
132
+ - Point-by-point addition visualization
133
+
134
+ **Content**
135
+ Show that adding waves means adding their heights at each point. Demonstrate with two specific frequencies combining.
136
+
137
+ **Narration Notes**
138
+ "Adding waves is simple -- at each point, just add the heights."
139
+
140
+ **Technical Notes**
141
+ - VGroup of three function graphs
142
+ - Vertical lines showing addition at specific x values
143
+ - Animate the addition happening
144
+
145
+ ---
146
+
147
+ ## Example 3: Matrix as Linear Transformation (EoLA Ch 3)
148
+
149
+ ### Scene 1: Grid Transformation
150
+ **Duration**: ~60 seconds
151
+ **Purpose**: THE fundamental 3b1b visual
152
+
153
+ **Visual Elements**
154
+ - 2D coordinate grid (NumberPlane)
155
+ - Basis vectors i-hat (GREEN) and j-hat (RED)
156
+ - Grid lines transforming
157
+
158
+ **Content**
159
+ Show a grid. Highlight i-hat (1,0) and j-hat (0,1). Apply a transformation -- watch the entire grid move while tracking where basis vectors land.
160
+
161
+ **Narration Notes**
162
+ "Watch what happens to the grid when we apply this transformation. Notice how every point moves."
163
+
164
+ **Technical Notes**
165
+ - NumberPlane with visible grid lines
166
+ - `apply_matrix()` method for the transformation
167
+ - Keep basis vectors visually distinct (GREEN, RED)
168
+ - run_time=3 for the transformation (let it breathe)
169
+
170
+ ---
171
+
172
+ ### Scene 2: Basis Vectors Determine Everything
173
+ **Duration**: ~90 seconds
174
+ **Purpose**: Key insight (this is the "aha moment" of the chapter)
175
+
176
+ **Visual Elements**
177
+ - Transformed i-hat and j-hat
178
+ - Arbitrary vector v (YELLOW) as combination
179
+ - v = xi + yj visualization
180
+
181
+ **Content**
182
+ Show that knowing where i-hat and j-hat land tells you where ANY vector lands. Because v = xi + yj, the transformed v = x(new i) + y(new j).
183
+
184
+ **Narration Notes**
185
+ "Here's the key insight..." Build anticipation before the reveal. Use FlashAround on the result.
186
+
187
+ **Technical Notes**
188
+ - Vector addition animation (tip-to-tail)
189
+ - Scaling animation for coefficients
190
+ - TransformMatchingShapes for the combination
191
+ - self.wait(2) after the insight
192
+
193
+ ---
194
+
195
+ ## Example 4: Autoregressive Text Generation (Transformers Series)
196
+
197
+ ### Scene 1: Black Box Input/Output
198
+ **Duration**: ~60 seconds
199
+ **Purpose**: Ground the abstract architecture in observable behavior
200
+
201
+ **Visual Elements**
202
+ - Text string as input
203
+ - MachineWithDials as the "model"
204
+ - Bar chart of next-token probabilities as output
205
+ - Highlight rect jumping between bars (random sampling)
206
+
207
+ **Content**
208
+ Show text flowing into a machine, probability distribution coming out, random sampling selecting the next token.
209
+
210
+ **Narration Notes**
211
+ "At its core, a large language model takes in text and predicts the next word."
212
+
213
+ **Technical Notes**
214
+ From `_2024/transformers/auto_regression.py`:
215
+ ```python
216
+ class SimpleAutogregression(InteractiveScene):
217
+ def new_selection_cycle(self, text_mob, next_word_line, machine, quick=False):
218
+ self.animate_text_input(text_mob, machine)
219
+ bar_groups = self.animate_prediction_output(machine, self.cur_str)
220
+ self.animate_random_sample(bar_groups)
221
+ new_text_mob = self.animate_word_addition(bar_groups, text_mob, next_word_line)
222
+ ```
223
+ - Live GPT-2 inference via `gpt2_predict_next_token()`
224
+ - `UpdateFromAlphaFunc` for the jumping highlight rect
225
+
226
+ ---
227
+
228
+ ### Scene 2: Opening the Machine
229
+ **Duration**: ~90 seconds
230
+ **Purpose**: Transition from black box to architecture overview
231
+
232
+ **Visual Elements**
233
+ - 3D transformer blocks (VPrism stack)
234
+ - Embedding array flowing through blocks
235
+ - Labels for attention, MLP layers
236
+
237
+ **Content**
238
+ "Open up the machine." Show the stack of transformer blocks. Data flows in one side, through alternating attention and MLP layers, out the other.
239
+
240
+ **Technical Notes**
241
+ From `_2024/transformers/network_flow.py`:
242
+ ```python
243
+ blocks = VGroup(VPrism(3, 2, 0.2) for n in range(10))
244
+ blocks.set_fill(GREY_D, 1)
245
+ blocks.set_shading(0.25, 0.5, 0.2)
246
+ blocks.arrange(OUT)
247
+ ```
248
+ - Camera reorientation: `frame.animate.reorient(theta, phi, 0)`
249
+ - ContextAnimation arcs between token positions
250
+
251
+ ---
252
+
253
+ ## Example 5: Bayesian Updating with Population Grid
254
+
255
+ ### Scene 1: The Medical Test Setup
256
+ **Duration**: ~45 seconds
257
+ **Purpose**: Concrete problem that traps intuition
258
+
259
+ **Visual Elements**
260
+ - Statement: "Test is 90% accurate. You test positive."
261
+ - Question: "What's the probability you have the disease?"
262
+ - Pi creature with "pondering" expression
263
+
264
+ **Content**
265
+ Present the medical test scenario. Most people answer "about 90%." This is wrong.
266
+
267
+ **Technical Notes**
268
+ - TeacherStudentsScene for emotional setup
269
+ - Text with key numbers color-coded
270
+
271
+ ---
272
+
273
+ ### Scene 2: Population Frequency Approach
274
+ **Duration**: ~120 seconds
275
+ **Purpose**: Make probability visual and countable
276
+
277
+ **Visual Elements**
278
+ - Grid of 1000 dots (Population class)
279
+ - 10 dots colored RED (disease positive)
280
+ - 990 dots colored GREEN (disease negative)
281
+ - Subset highlighting for test results
282
+
283
+ **Content**
284
+ Show 1000 people. 10 have disease (RED). 990 are healthy (GREEN). Now apply the test: 9 of 10 sick test positive. 89 of 990 healthy test positive (false positives!). P(sick|positive) = 9/(9+89) = 9.2%.
285
+
286
+ **Narration Notes**
287
+ The FALSE POSITIVE group is the surprise. Color them GREEN+bright to show they're HEALTHY but tested positive.
288
+
289
+ **Technical Notes**
290
+ From `_2020/med_test.py`:
291
+ - Population class creates the grid
292
+ - Subset coloring with SurroundingRectangle
293
+ - AnimationGroup for simultaneous color changes
294
+ - self.wait(2) after revealing the surprisingly low probability
295
+
296
+ ---
297
+
298
+ ## Example 6: Galton Board Simulation (CLT)
299
+
300
+ ### Scene 1: The Physical Setup
301
+ **Duration**: ~30 seconds
302
+ **Purpose**: Ground the abstract in the physical
303
+
304
+ **Visual Elements**
305
+ - Peg array (triangular grid)
306
+ - Ball at the top
307
+ - Bins at the bottom
308
+
309
+ **Content**
310
+ "Imagine dropping a ball through a field of pegs."
311
+
312
+ **Technical Notes**
313
+ From `_2023/clt/galton_board.py`:
314
+ - Physical simulation with collision detection
315
+ - `self.add_sound("clack")` for ball-peg impacts
316
+
317
+ ---
318
+
319
+ ### Scene 2: Many Balls
320
+ **Duration**: ~90 seconds
321
+ **Purpose**: Show distribution emerging from randomness
322
+
323
+ **Visual Elements**
324
+ - Dozens of balls dropping simultaneously
325
+ - Bins filling up (bar chart growing)
326
+ - Gaussian curve overlay appearing
327
+
328
+ **Content**
329
+ Drop many balls. Watch the bins fill up into a bell curve shape. Overlay the Gaussian formula.
330
+
331
+ **Technical Notes**
332
+ - Progressive speed-up: first 10 balls animated fully, rest quick
333
+ - Bar chart using ChartBars with gradient coloring
334
+ - Gaussian curve in YELLOW overlaid with `always_redraw`
335
+
336
+ ---
337
+
338
+ ## Scene Transition Patterns
339
+
340
+ ### Zoom Focus
341
+ ```
342
+ Full scene -> Zoom into detail -> Explain -> Zoom out
343
+ ```
344
+ Implementation: `frame.animate.set_height(smaller)` + `frame.animate.move_to(target)`
345
+
346
+ ### Side-by-Side Build
347
+ ```
348
+ Empty left | Empty right
349
+ Add to left | Compare
350
+ Add to right | Connect them
351
+ ```
352
+ Implementation: `VGroup.to_edge(LEFT/RIGHT)` with `Line` or `Arrow` between
353
+
354
+ ### Transform Chain
355
+ ```
356
+ Object A -> Transform -> Object B -> Transform -> Object C
357
+ (Maintain visual continuity throughout)
358
+ ```
359
+ Implementation: `TransformMatchingTex` or `FadeTransform` for smooth continuity
360
+
361
+ ### Reset and Rebuild
362
+ ```
363
+ Complex scene -> FadeOut most -> Focus on one element -> Build new complexity
364
+ ```
365
+ Implementation: `FadeOut(VGroup(*to_remove))` then progressive `FadeIn/Write` of new elements
366
+
367
+ ### The "Fourier Land" Split
368
+ ```
369
+ Time domain (left) | Frequency domain (right)
370
+ Operate in time | Watch frequency response
371
+ ```
372
+ Implementation: `FullScreenRectangle().stretch(0.5, 0).set_fill(TEAL, 0.2)` for visual domain separation
373
+
374
+ ### Phase Space Dual View
375
+ ```
376
+ Physical system (left/top) | Phase portrait (right/bottom)
377
+ System evolves | Trajectory traced in phase space
378
+ ```
379
+ Implementation: Linked via updaters; physical system state drives dot position on phase plane