Skip to main content

Animation engine for explanatory math videos

Project description

manim_express

image image image image

Requirements

manimgl>=1.3.0
manim>=0.13.1
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 键 或 ctrl键 同时滚动鼠标滚轮以缩放画面.
    • 通过 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
    CONFIG.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

  • Bezier curve

  • GOA model

  • GOA

  • 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.

Source Distribution

manim_express-0.5.5.tar.gz (17.7 MB view hashes)

Uploaded Source

Built Distribution

manim_express-0.5.5-py3-none-any.whl (704.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page