manim:用于數(shù)學(xué)繪圖(動(dòng)畫(huà)),比如數(shù)學(xué)教程。
首先,建議大家去github按官方的安裝。
github-manim
下面提供我安裝的過(guò)程(win10-64),盡量詳細(xì)點(diǎn)哈。
安裝ffmpeg
地址:FFmpeg
直接下載壓縮包,解壓后設(shè)置環(huán)境變量即可。因?yàn)檫@里官網(wǎng)的安裝步驟太過(guò)細(xì)節(jié)了
將bin目錄添加到環(huán)境變量
安裝miktex
地址:miktex
這個(gè)是支持latex語(yǔ)法的
將bin\x64目錄添加到環(huán)境變量
安裝pycairo
pip安裝即可
安裝manim(如果用anaconda管理,建議新建環(huán)境去安裝)
這里直接照搬github上官方的:
git clone https://github.com/3b1b/manim.git # git下載
cd manim # 切換到下載的目錄
pip install -e . # pip安裝
其他安裝(可選)
- sox:音頻處理
- dvisvgm:用于轉(zhuǎn)svg格式
官方的一些提示(manimgl 命令的一些參數(shù))
-w to write the scene to a file
-o to write the scene to a file and open the result
-s to skip to the end and just show the final frame.
-so will save the final frame to an image and show it
-n <number> to skip ahead to the n'th animation of a scene.
-f to make the playback window fullscreen
配置修改
目前剛安裝,還沒(méi)玩熟悉,所以只說(shuō)我知道的。
- 進(jìn)入manimlib目錄,修改default_config.yml文件,主要是設(shè)置directories下的參數(shù),比較好理解
運(yùn)行
官方示例:
# 先進(jìn)入manim目錄
manimgl example_scenes.py OpeningManimExample # 運(yùn)行示例,過(guò)程中可能會(huì)提示安裝一些宏包(我也不懂),安裝就是了。這個(gè)示例有交互功能
在目錄中可以找到示例文件,對(duì)照著參考編碼學(xué)習(xí)即可。深入學(xué)習(xí)那就參考官方文檔吧。