Loading...
Loading...
Compare original and translation side by side
| File | Purpose |
|---|---|
| Common scene patterns for different concept types with reusable templates |
| Wrapper around Manim CLI — handles quality, format, output path cleanup |
| 文件路径 | 用途 |
|---|---|
| 针对不同概念类型的常见场景模式,包含可复用模板 |
| Manim CLI的封装脚本 — 处理画质、格式、输出路径清理等操作 |
Concept → Manim scene (.py) → Preview (low-quality) → Iterate → Final render (MP4/GIF)-qlscripts/render_video.py概念 → Manim场景文件(.py) → 预览(低画质) → 迭代优化 → 最终渲染(MP4/GIF)-qlscripts/render_video.pyundefinedundefined
Verify with: `python3 -c "import manim; print(manim.__version__)"`
验证安装:`python3 -c "import manim; print(manim.__version__)"`references/scene-patterns.md| User intent | Animation pattern | Key Manim primitives |
|---|---|---|
| Explain a pipeline/flow | Sequential flow animation | Arrow, Rectangle, Text, AnimationGroup |
| Show architecture layers | Layer build-up | VGroup, Arrange, FadeIn with shift |
| Algorithm step-through | State machine transitions | Transform, ReplacementTransform, Indicate |
| Compare approaches | Side-by-side morph | Split screen VGroups, simultaneous animations |
| Data transformation | Object metamorphosis | Transform chains, color transitions |
| Mathematical concept | Equation + geometric proof | MathTex, geometric shapes, Rotate, Scale |
| Agent/multi-system interaction | Message passing animation | Arrows between entities, Create/FadeOut |
| Training/optimization loop | Iterative cycle animation | Loop with Transform, ValueTracker, plots |
| Timeline/history | Left-to-right progression | NumberLine, sequential Indicate |
references/scene-patterns.md| 用户需求 | 动画模式 | 核心Manim原语 |
|---|---|---|
| 讲解流程/数据流 | 顺序流动画 | Arrow, Rectangle, Text, AnimationGroup |
| 展示架构分层 | 分层构建动画 | VGroup, Arrange, FadeIn with shift |
| 算法分步演示 | 状态机转场动画 | Transform, ReplacementTransform, Indicate |
| 对比不同方案 | 并排变形动画 | 分屏VGroups, 同步动画 |
| 数据转换 | 对象变形动画 | 变换链、颜色过渡 |
| 数学概念 | 公式+几何证明动画 | MathTex, 几何图形, Rotate, Scale |
| Agent/多系统交互 | 消息传递动画 | 实体间箭头、Create/FadeOut |
| 训练/优化循环 | 迭代循环动画 | 带Transform的循环、ValueTracker、图表 |
| 时间线/历史 | 从左到右推进动画 | NumberLine, 顺序Indicate |
.pyclass XxxScene(Scene)self.wait()font_size=36font_size=48+.pyclass XxxScene(Scene)self.wait()font_size=36font_size=48undefinedundefinedundefinedundefinedfrom manim import *
class ConceptScene(Scene):
def construct(self):
# === Section 1: Title / Setup ===
title = Text("Concept Name", font_size=56, weight=BOLD)
self.play(Write(title))
self.wait(1)
self.play(FadeOut(title))
# === Section 2: Core animation ===
# ... main content here ...
# === Section 3: Summary / Conclusion ===
# ... wrap-up animation ...
self.wait(2)from manim import *
class ConceptScene(Scene):
def construct(self):
# === 第一部分:标题/初始化 ===
title = Text("概念名称", font_size=56, weight=BOLD)
self.play(Write(title))
self.wait(1)
self.play(FadeOut(title))
# === 第二部分:核心动画 ===
# ... 此处为主要内容 ...
# === 第三部分:总结/结尾 ===
# ... 收尾动画 ...
self.wait(2)python3 scripts/render_video.py scene.py ConceptScene --quality low --format mp4python3 scripts/render_video.py scene.py ConceptScene --quality low --format mp4| Request | Action |
|---|---|
| "Slower/faster" | Adjust |
| "Change colors" | Update color constants |
| "Add a step" | Insert new animation block between sections |
| "Reorder" | Move code blocks around |
| "Different layout" | Adjust |
| "Add labels/annotations" | Add |
| "Make it loop" | Add matching intro/outro states |
| 用户请求 | 处理方式 |
|---|---|
| "放慢/加快速度" | 调整 |
| "修改颜色" | 更新颜色常量 |
| "添加一个步骤" | 在段落之间插入新的动画代码块 |
| "调整顺序" | 移动代码块的位置 |
| "更改布局" | 调整 |
| "添加标签/注释" | 使用 |
| "设置为循环播放" | 添加匹配的开场/收尾状态 |
python3 scripts/render_video.py scene.py ConceptScene --quality high --format mp4python3 scripts/render_video.py scene.py ConceptScene --quality high --format mp4| Preset | Resolution | FPS | Flag | Use case |
|---|---|---|---|---|
| 480p | 15 | | Fast preview |
| 720p | 30 | | Draft review |
| 1080p | 60 | | Final delivery |
| 2160p | 60 | | Presentation quality |
| 预设 | 分辨率 | 帧率 | 参数 | 使用场景 |
|---|---|---|---|---|
| 480p | 15 | | 快速预览 |
| 720p | 30 | | 草案评审 |
| 1080p | 60 | | 最终交付 |
| 2160p | 60 | | 演示级画质 |
| Format | Flag | Use case |
|---|---|---|
| | Standard video delivery |
| | Embeddable in docs, social |
| | Web-optimized |
| 格式 | 参数 | 使用场景 |
|---|---|---|
| | 标准视频交付 |
| | 可嵌入文档、社交媒体 |
| | 网页优化格式 |
.py/mnt/user-data/outputs/.py/mnt/user-data/outputs/| Error | Cause | Resolution |
|---|---|---|
| Manim not installed | Run Step 0 setup commands |
| Missing system dev headers | |
| ffmpeg not installed | |
| Scene class not found | Class name mismatch | Verify class name matches CLI argument |
| Overlapping objects | Positions not calculated | Use |
| Text cut off | Text too large or positioned near edge | Reduce |
| Slow render | Too many objects or complex transformations | Reduce object count, simplify paths, use lower quality |
| LaTeX not installed (for MathTex) | Use |
| 错误 | 原因 | 解决方法 |
|---|---|---|
| 未安装Manim | 执行步骤0的安装命令 |
| 缺少系统开发依赖头文件 | 执行 |
| 未安装ffmpeg | 执行 |
| 找不到Scene类 | 类名不匹配 | 验证类名与CLI参数是否一致 |
| 对象重叠 | 位置计算错误 | 使用 |
| 文本被截断 | 文本过大或位置靠近画布边缘 | 减小 |
| 渲染速度慢 | 对象过多或变换复杂 | 减少对象数量、简化路径、使用更低画质 |
| 未安装LaTeX(用于MathTex) | 改用 |
MathTexTexTextundefinedMathTexTexTextundefinedundefinedundefined