Skip to content

CONFIG cleanup #648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 130 additions & 113 deletions manim/mobject/geometry.py

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions manim/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,12 @@ class Mobject(Container):

"""

CONFIG = {
"color": WHITE,
"name": None,
"dim": 3,
"target": None,
"z_index": 0,
}

def __init__(self, **kwargs):
def __init__(self, color=WHITE, name=None, dim=3, target=None, z_index=0, **kwargs):
self.color = color
self.name = name
self.dim = dim
self.target = target
self.z_index = z_index
Container.__init__(self, **kwargs)
self.point_hash = None
self.submobjects = []
Expand Down
5 changes: 0 additions & 5 deletions manim/mobject/types/vectorized_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
# TODO
# - Change cubic curve groups to have 4 points instead of 3
# - Change sub_path idea accordingly
# - No more mark_paths_closed, instead have the camera test
# if last point in close to first point
# - Think about length of self.points. Always 0 or 1 mod 4?
# That's kind of weird.

Expand All @@ -59,9 +57,6 @@ class VMobject(Mobject):
# secondary color in the direction of sheen_direction.
"sheen_factor": 0.0,
"sheen_direction": UL,
# Indicates that it will not be displayed, but
# that it should count in parent mobject's path
"close_new_points": False,
"pre_function_handle_to_anchor_scale_factor": 0.01,
"make_smooth_after_applying_functions": False,
"background_image_file": None,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
52 changes: 49 additions & 3 deletions tests/test_graphical_units/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def construct(self):

class ArcTest(Scene):
def construct(self):
a = Arc(PI)
a = Arc(start_angle=PI)
self.play(Animation(a))


Expand All @@ -23,6 +23,18 @@ def construct(self):
self.play(Animation(a))


class ArrowTest(Scene):
def construct(self):
a = Arrow()
self.play(Animation(a))
b = (
Arrow(color=RED, stroke_width=12, end=2 * LEFT, start=2 * RIGHT)
.scale(2)
.shift(UP)
)
self.play(Animation(b))


class CurvedArrowTest(Scene):
def construct(self):
a = CurvedArrow(np.array([1, 1, 0]), np.array([2, 2, 0]))
Expand All @@ -34,8 +46,8 @@ def construct(self):
from manim.mobject.geometry import ArrowCircleTip, ArrowSquareFilledTip

a = DoubleArrow(
np.array([-1, -1, 0]),
np.array([1, 1, 0]),
start=np.array([-1, -1, 0]),
end=np.array([1, 1, 0]),
tip_shape_start=ArrowCircleTip,
tip_shape_end=ArrowSquareFilledTip,
)
Expand All @@ -48,6 +60,14 @@ def construct(self):
self.play(Animation(circle))


class SmallDotTest(Scene):
def construct(self):
a = SmallDot()
self.play(Animation(a))
b = SmallDot(color=BLUE).shift(UP)
self.play(Animation(b))


class DotTest(Scene):
def construct(self):
dot = Dot()
Expand Down Expand Up @@ -90,6 +110,32 @@ def construct(self):
self.play(Animation(a))


class DashedLineTest(Scene):
def construct(self):
a = DashedLine()
self.play(Animation(a))


class CustomDashedLineTest(Scene):
def construct(self):
a = DashedLine(end=2 * DOWN, start=2 * UP, dash_length=0.5)
self.play(Animation(a))


class TangentLineTest(Scene):
def construct(self):
circle = Circle(color=WHITE)
self.add(circle)
t1 = TangentLine(circle, 0.5, color=BLUE)
self.play(Animation(t1))
t2 = TangentLine(circle, 1.0, length=2, color=RED)
self.play(Animation(t2))
t3 = TangentLine(circle, 0.75, length=5, d_alpha=0.1, color=YELLOW)
self.play(Animation(t3))
t4 = TangentLine(circle, 0.321, length=1.5, d_alpha=-0.1, color=GREEN)
self.play(Animation(t4))


class Elbowtest(Scene):
def construct(self):
a = Elbow()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_scene_rendering/test_caching_related.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ..utils.video_tester import *


@pytest.mark.slow
@video_comparison(
"SceneWithMultipleWaitCallsWithNFlag.json",
"videos/simple_scenes/480p15/SceneWithMultipleWaitCalls.mp4",
Expand All @@ -29,6 +30,7 @@ def test_wait_skip(tmp_path, manim_cfg_file, simple_scenes_path):
assert exit_code == 0, err


@pytest.mark.slow
@video_comparison(
"SceneWithMultiplePlayCallsWithNFlag.json",
"videos/simple_scenes/480p15/SceneWithMultipleCalls.mp4",
Expand Down