Manim - Python 绘画引擎

ops/2024/9/23 6:20:27/

在这里插入图片描述


文章目录

    • 关于 Manim
    • 安装
      • manim 有两个版本
      • 要求
      • 直接使用 pip
      • 使用源码安装
    • 使用 manim
    • Manual


关于 Manim

Manim : Mathematical Animation,是由 Grant Sanderson 开发,是一个用于精确编程动画的引擎,专为创建解释性数学视频而设计。

  • github : https://github.com/3b1b/manim
  • 文档:https://3b1b.github.io/manim/
    https://docs.manim.org.cn/cairo-backend/getting_started/index.html >
  • 中文教程:https://docs.manim.org.cn/
  • manim-kindergarten : https://github.com/manim-kindergarten/manim_sandbox
  • ManimCommunity : https://github.com/ManimCommunity/manim
    https://www.manim.community

相关教程/博客
-【2024最新教程】Manim动画软件教程,像3blue1brown那样做动画【更新中】
https://www.bilibili.com/video/BV1om411k7Fv/


安装

manim__27">manim 有两个版本

1、该存储库最初是3Blue1Brown作者的个人项目,旨在为这些视频制作动画,视频特定的代码可在此处获取。
2、2020 年,一群开发人员将其分叉为 社区版本,目标是更稳定、更好的测试、更快地响应社区贡献以及更容易上手。
请参阅此页面了解更多详细信息。

警告:这些说明 仅适用于 ManimGL 。尝试使用这些说明来安装ManimCommunity/manim 或那里的说明来安装此版本将导致问题。
您应该首先决定要安装哪个版本,然后仅按照您所需版本的说明进行操作。

注意:如果直接通过pip安装manim,请注意安装包的名称。这个存储库是 3b1b 的 ManimGL。
包名称是manimgl,代替manimmanimlib
请使用pip install manimgl安装此存储库的版本。


要求

1、Manim 在 Python 3.7 或更高版本上运行。
2、系统要求是FFmpeg、OpenGL和LaTeX(可选,如果您想使用 LaTeX)。
对于 Linux,需要Pango及其开发头文件。请参阅此处的说明。


macOS 安装 FFMpeg 可参考:https://blog.csdn.net/lovechris00/article/details/125921387

brew install ffmpeg mactex

Windows

  1. 安装 FFmpeg。
  2. 安装 LaTeX 发行版。推荐MiKTeX 。

直接使用 pip

# Install manimgl
pip install manimgl# Try it out
manimgl

使用源码安装

如果您想修改 manimlib,请克隆此存储库并在该目录中执行:

# Install manimgl
pip install -e .# Try it out
manimgl example_scenes.py OpeningManimExample
# or
manim-render example_scenes.py OpeningManimExample

manim_84">使用 manim

下载git 源码包后,尝试运行以下命令:

manimgl example_scenes.py OpeningManimExample

这应该会弹出一个窗口,播放一个简单的场景。
一些有用的标志包括:

  • -w将场景写入文件
  • -o将场景写入文件并打开结果
  • -s,跳到最后并只显示最后一帧。
    • -so将最终帧保存到图像中并显示它
  • -n <number>向前跳至n场景的第一个动画
  • -f使播放窗口全屏显示

Manual

manimgl --help   

ManimGL v1.6.1

usage: manimgl [-h] [-w] [-s] [-l] [-m] [–hd] [–uhd] [-f] [-p] [-g] [-i] [-t] [-q] [-a] [-o] [–finder] [–config] [–file_name FILE_NAME] [-n START_AT_ANIMATION_NUMBER] [-e LINENO] [-r RESOLUTION] [–frame_rate FRAME_RATE] [-c COLOR] [–leave_progress_bars] [–video_dir VIDEO_DIR] [–config_file CONFIG_FILE] [-v] [–log-level LOG_LEVEL] [file] [scene_names …]

positional arguments:
file, Path to file holding the python code for the scene
scene_names, Name of the Scene class you want to see


options:

  • -h, --help, show this help message and exit
  • -w, --write_file, Render the scene as a movie file
  • -s, --skip_animations
    Save the last frame
  • -l, --low_quality, Render at a low quality (for faster rendering)
  • -m, `–medium_quality Render at a medium quality
  • --hd, `, Render at a 1080p
  • --uhd, Render at a 4k
  • -f, --full_screen, Show window in full screen
  • -p, `–presenter_mode Scene will stay paused during wait calls until space bar or right arrow is hit, like a slide show
  • -g, --save_pngs, Save each frame as a png
  • -i, --gif, Save the video as gif
  • -t, --transparent, Render to a movie file with an alpha channel
  • -q, `–quiet
  • -a, --write_all, Write all the scenes from a file
  • -o, --open, Automatically open the saved file once its done
  • --finder, Show the output file in finder
  • --config, Guide for automatic configuration
  • --file_name FILE_NAME
    Name for the movie or image file
  • -n START_AT_ANIMATION_NUMBER, --start_at_animation_number START_AT_ANIMATION_NUMBER
    Start rendering not from the first animation, butfrom another, specified by its index. If you passin two comma separated values, e.g. “3,6”, it`
    will endthe rendering at the second value
  • -e LINENO, --embed LINENO
    Takes a line number as an argument, and resultsin the scene being called as if the line self.embed()was inserted into the scene code at that`
    line number.
  • -r RESOLUTION, --resolution RESOLUTION
    Resolution, passed as “WxH”, e.g. “1920x1080”
  • --frame_rate FRAME_RATE
    Frame rate, as an integer
  • -c COLOR, --color COLOR
    Background color
  • --leave_progress_bars
    Leave progress bars displayed in terminal
  • --video_dir VIDEO_DIR
    Directory to write video
  • --config_file CONFIG_FILE
    Path to the custom configuration file
  • -v, --version, Display the version of manimgl
  • --log-level LOG_LEVEL
    Level of messages to Display, can be DEBUG / INFO / WARNING / ERROR / CRITICAL

2024-04-22(一)


http://www.ppmy.cn/ops/23875.html

相关文章

navicat连接postgresql报错解决方案

navicat连接postgresql报错解决方案 问题描述原因分析&#xff1a;解决方案&#xff1a;1、将navicat升级到16.2以上版本2、降级pgsql3、修改dll配置文件 问题描述 使用Navicat连接postgresql时&#xff0c;出现如下错误。 原因分析&#xff1a; 由于pgsql 15版本以后&#…

java-Spring-(MyBatis框架-xml管理)

目录 前置条件 xml与注解比较 1.1 xml定义 1.2 和SQL注解比较 建包准备 插入数据 ​编辑 更新数据 删除数据 查询数据 查看单字段查询 &#x1f3f7;&#x1f4a3;前置条件 创建一个spring boot 初始化的项目 &#x1f3f7;&#x1f4a3;xml与注解比较 1.1 xml定义 …

优路教育:提质数字人才培育,增效数字经济发展

为发挥数字人才支撑数字经济的基础性作用&#xff0c;加快推动形成新质生产力&#xff0c;相关部门于近日联合发布《加快数字人才培育支撑数字经济发展行动方案&#xff08;2024&#xff0d;2026年&#xff09;》&#xff08;以下简称方案&#xff09;&#xff0c;要求紧贴数字…

竟然还有这么省钱方便的寄快递方式?你竟然不知道!

选择闪侠惠递平台寄快递&#xff0c;这个价格来说真的很亲民了&#xff0c;而且可以多家快递进行比较&#xff0c;全国上门取件&#xff0c;这个真的很不错了。闪侠惠递是个靠谱的平台&#xff0c;售后以及取件率都必须好的。 闪侠惠递平台折扣力度非常棒的&#xff01;因为渠…

安卓手机APP开发__媒体开发部分__APK裁剪

安卓手机APP开发__媒体开发部分__APK裁剪 目录 概述 仅使用必要的依赖 启用代码和资源的裁剪 指定你的APP需要哪一个渲染器 指定你的APP需要哪个抽取器 定制媒体源的实例化 概述 最小化APK的大小是开发一个好的安卓APP的一个重要的方面.当面向的是正在开发 的市场时更是…

朋友们,帮忙填写一个问卷呀!关于高速服务区一体化车流管理系统的线上调研,急需各位大神的帮助!!!

✌ 作者简介&#xff1a;瑞骏 RUIJUN &#x1f4eb; 如果文章知识点有错误的地方&#xff0c;请指正&#xff01;和大家一起学习&#xff0c;一起进步&#x1f440; &#x1f4ac; 人生格言&#xff1a;没有我不会的语言&#xff0c;没有你过不去的坎儿。&#x1f4ac; &#x…

Mysql常用关键字详解

关键字详解与应用 SELECT 用途: 选择表中的一列或多列数据。常见问题: 如何选择不同表中的数据并进行合并&#xff1f;解决方案: 使用 JOIN 关键字来连接表&#xff0c;并通过 ON 条件指定连接条件。 SELECT a.name, b.salary FROM employees a JOIN salaries b ON a.employee_…

docker部署prometheus

概述 Prometheus是一个开源的服务监控系统和时序数据库&#xff0c;专为云计算环境设计。它提供了通用的数据模型和快捷的数据采集、存储和查询接口。Prometheus的核心组件Prometheus server会定期从静态配置的监控目标或者基于服务发现自动配置的目标中拉取数据。当新拉取到的…