Files
dsProject/dsLightRag/Manim/L14_MovingFrameBox.py
2025-08-14 15:45:08 +08:00

35 lines
865 B
Python

#%%
import manim
#%%
from manim import *
class MovingFrameBox(Scene):
def construct(self):
text=MathTex(
"\\frac{d}{dx}f(x)g(x)=","f(x)\\frac{d}{dx}g(x)","+",
"g(x)\\frac{d}{dx}f(x)"
)
self.play(Write(text))
framebox1 = SurroundingRectangle(text[1], buff = .1)
framebox2 = SurroundingRectangle(text[3], buff = .1)
self.play(
Create(framebox1),
)
self.wait()
self.play(
ReplacementTransform(framebox1,framebox2),
)
self.wait()
if __name__ == '__main__':
config = {
"quality": "medium_quality",
"preview": True,
"media_dir": "./logo_output",
"pixel_height": 1080,
"pixel_width": 1920
}
with manim.tempconfig(config):
scene = MovingFrameBox()
scene.render()