Skip to main content

Animation engine for explanatory math videos

Project description

manim_express

image image image image

Requirements

manim_kunyuan >= 0.27
sparrow_tool
fake_headers
requests
# helium
# pyperclip

English | 中文说明

Install

pip install manim_express

以上步骤将安装 manim_expressmanimlib. 然后就可以在任何代码位置导入使用这个动画库了.

快速开始

  • 渲染一个动画: 3b1b:SquareToCircle

    from manimlib import *
    from manim_express import EagerModeScene
    
    scene = EagerModeScene()
    circle = Circle()
    circle.set_fill(BLUE, opacity=0.5)
    circle.set_stroke(BLUE_E, width=4)
    
    square = Square()
    scene.play(ShowCreation(square))
    scene.play(ReplacementTransform(square, circle))
    
    scene.hold_on()
    

    与渲染画面交互:

    • 按住 d 键 然后移动鼠标可以改变三维空间中相机的旋转视角.
    • 按住 s 键 然后移动鼠标可以平移相机.
    • 按住 z 键 同时滚动鼠标滚轮以缩放画面.
    • 通过 r 重制相机视角.
    • 离开/退出当前动画: q or tab
    • 暂停动画: space or ctrl
    • 前一段动画: LEFT
    • 后一段动画: RIGHT
    • 重新播放当前动画: DOWN
  • manim_express vs Matplotlib:
    在某些情况你需要安装LaTeX 以渲染 tex 字体.
    幸运的是manim_express中提供了在线的latex 编译选项. 通过设置 SceneArgs.use_online_tex=True 进行激活.

    from manimlib import *
    from manim_express import *
    import numpy as np
    SceneArgs.use_online_tex = True # Use online latex compiler
    
    theta = np.linspace(0, 2*np.pi, 200)
    x = np.cos(theta)
    y = np.sin(theta)
    
    # matplotlib
    # import matplotlib.pyplot as plt
    # plt.plot(x, y, color='green', linewidth=2)
    # plt.axis("equal")
    # plt.show()
    
    # manim_express
    scene = EagerModeScene()
    scene.plot(x, y, color=GREEN, width=2, scale_ratio=1)
    scene.show_plot()
    
    scene.hold_on()
    

资源

Examples

  • GOA model

  • Apply function

  • Double pendulum

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for manim-express, version 0.4.5
Filename, size File type Python version Upload date Hashes
Filename, size manim_express-0.4.5-py3-none-any.whl (238.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size manim_express-0.4.5.tar.gz (196.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page