作物杂种动画以匹配内容大小
对于以下Manim代码,我想(自动)生成一个仅包含等式eq
的动画,周围没有空白空间。我该怎么做?
from manim import *
class EquationScene(Scene):
def construct(self):
eq = MathTex('a^2 + b^2 = c^2')
self.play(Write(eq))
# Crop image here, somehow?
如果不能纯粹是在Manim中进行的,那么我将对其他方法开放,例如使用ImageMagick裁剪图像。 (但是,该方法必须是自动的。我显然不想每次修改它时都必须手动裁剪每张图像。)
另请参阅一个相关的问题在这里。
For the following Manim code, I would like to (automatically) produce an animation that only contains the equation eq
with no empty space surrounding it. How can I accomplish this?
from manim import *
class EquationScene(Scene):
def construct(self):
eq = MathTex('a^2 + b^2 = c^2')
self.play(Write(eq))
# Crop image here, somehow?
If this cannot be done purely in Manim, I'm open to other approaches, such as using ImageMagick to crop the images. (The method must be automatic, however. I obviously don't want to have to manually crop every image each time I modify it.)
See also a related question here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个片段,将在渲染后产生一个空的输出映像 - 同时在工作目录中编写文件
captured_mobject.png
,其中包含所需的输出。Here is a snippet which will, upon rendering, produce an empty output image -- while at the same time writing a file
captured_mobject.png
in your working directory which contains the desired output.