Manim
执行:manim -p Logo.py ManimCELogo
Logo.py(官网的示例):
from manim import *
class ManimCELogo(Scene):
def construct(self):
self.camera.background_color = "#ece6e2"
logo_green = "#87c2a5"
logo_blue = "#525893"
logo_red = "#e07a5f"
logo_black = "#343434"
ds_m = MathTex(r"\mathbb{M}", fill_color=logo_black).scale(7)
ds_m.shift(2.25 * LEFT + 1.5 * UP)
circle = Circle(color=logo_green, fill_opacity=1).shift(LEFT)
square = Square(color=logo_blue, fill_opacity=1).shift(UP)
triangle = Triangle(color=logo_red, fill_opacity=1).shift(RIGHT)
logo = VGroup(triangle, square, circle, ds_m) # order matters
logo.move_to(ORIGIN)
self.add(logo)
错误:
ValueError: Your installation does not support converting .dvi files to SVG. Consider
updating dvisvgm to at least version 2.4. If this does not solve the problem, please
refer to our troubleshooting guide at:
https://docs.manim.community/en/stable/faq/general.html#my-installation-does-not-support-converting-pdf-to-svg-help
软件版本:
Python3.10.7
Manim Community v0.17.3
MiKTeX 23.4
ffmpeg
dvisvgm 2.4
这段代码看起来没有明显的语法错误,但是可能存在以下问题:
变量名称拼写错误:在代码中,ds_m
变量的值为 MathTex
对象,但是在后面的代码中,却将其命名为 ds_m
,这可能会导致后续代码无法正常工作。建议将 ds_m
改为正确的变量名。
图片路径错误:在代码中,使用了 MathTex
对象来加载一个数学符号的图片,但是图片的路径可能不正确。建议检查图片路径是否正确,并确保图片文件存在。
缺少导入语句:在代码中,使用了 MathTex
和 Circle
、Square
、Triangle
等类,但是没有导入相关的模块。建议在代码开头添加相应的导入语句,以便正确使用这些类。
逻辑错误:在代码中,使用了一些逻辑控制语句来控制图形的绘制顺序和位置,但是这些语句可能存在逻辑错误。建议仔细检查代码,确保逻辑正确。
希望这些提示对你有所帮助!