manim/tests/test_graphical_units/test_mobjects.py
Darylgolden 6018ebf445 Revert "Merge branch 'main' of https://github.com/ManimCommunity/manim"
This reverts commit e7f9d23aa7, reversing
changes made to afe91d02b6.
2023-07-31 15:29:39 +08:00

38 lines
996 B
Python

from __future__ import annotations
from manim import *
from manim.utils.testing.frames_comparison import frames_comparison
__module_test__ = "mobjects"
@frames_comparison(base_scene=ThreeDScene)
def test_PointCloudDot(scene):
p = PointCloudDot()
scene.add(p)
@frames_comparison
def test_become(scene):
s = Rectangle(width=2, height=1, color=RED).shift(UP)
d1, d2, d3 = (Dot() for _ in range(3))
s1 = s.copy().become(d1, match_width=True).set_opacity(0.25).set_color(BLUE)
s2 = (
s.copy()
.become(d2, match_height=True, match_center=True)
.set_opacity(0.25)
.set_color(GREEN)
)
s3 = s.copy().become(d3, stretch=True).set_opacity(0.25).set_color(YELLOW)
scene.add(s, d1, d2, d3, s1, s2, s3)
@frames_comparison
def test_match_style(scene):
square = Square(fill_color=[RED, GREEN], fill_opacity=1)
circle = Circle()
VGroup(square, circle).arrange()
circle.match_style(square)
scene.add(square, circle)