3b1b / manim

Animation engine for explanatory math videos
MIT License
70.79k stars 6.23k forks source link

Lines and curves rendered in a strange way #2043

Open mathematics128 opened 1 year ago

mathematics128 commented 1 year ago

Describe the error

Today I uninstalled my old manimgl installed from pypi and installed manimgl from master. Then I rendered my old video project. However, I got a unexpected effect. Every line seems to be faded in and faded out, includes sides of polygon, arrows, number lines. What's more, curves are sectionally faded out, which makes it looks like dashed... Not only my project but the examples did so.

Code and Error

Code:

# Hope my code is easy looking... I didn't write notes
def construct(self):
        axes1 = Axes(x_range=(-1, 2), y_range=(0, 6), height=4.8, width=2.4)
        axes1.to_edge(LEFT)
        coord_a = axes1.c2p(2, math.sqrt(32))
        coord_b = axes1.c2p(0, 0)
        coord_c = axes1.c2p(2, 0)
        coord_d = axes1.c2p(2, math.sqrt(2))
        dot_a = Dot(coord_a, fill_color=BLUE_C)
        dot_b = Dot(coord_b, fill_color=BLUE_C)
        dot_c = Dot(coord_c, fill_color=BLUE_C)
        dot_d = Dot(coord_d, fill_color=BLUE_C)
        label_a = Text("A", slant=ITALIC, font_size=36)
        label_b = Text("B", slant=ITALIC, font_size=36)
        label_c = Text("C", slant=ITALIC, font_size=36)
        label_d = Text("D", slant=ITALIC, font_size=36)
        label_a.next_to(dot_a, UP)
        label_b.next_to(dot_b, DOWN)
        label_c.next_to(dot_c, DOWN)
        label_d.next_to(dot_d, RIGHT)
        triangle_abc = Polygon(coord_a, coord_b, coord_c)
        triangle_abc.set_stroke(BLUE_C, width=4)
        rectangle = Square(0.24)
        rectangle.set_stroke(BLUE_C, width=2)
        rectangle.set_fill(BLUE_C, opacity=0.25)
        rectangle.move_to(axes1.c2p(1.85, 0.15))
        segment_cd = Line(coord_c, coord_d, color=YELLOW_C)
        segment_cd.set_opacity(0.5)
        length_cd = Tex(r"\sqrt{2}", font_size=36)
        length_cd.next_to(segment_cd)
        geometry_graph = VGroup(triangle_abc, dot_a, dot_b, dot_c, dot_d,
                                label_a, label_b, label_c, label_d,
                                rectangle, length_cd)

        axes2 = Axes(x_range=(0, 13, 2), y_range=(0, 20, 2), height=6, width=3.9,
                     axis_config={"stroke_width": 2, "include_tip": False})
        # axes2.add_coordinate_labels(font_size=60)
        axes2.to_edge(RIGHT)  # .scale(0.3)
        lable_position = axes2.c2p(10, 19.5)
        function_graph = axes2.get_graph(lambda x: (x - 4) ** 2 + 2,
                                         color=RED_C, x_range=[2, 8])

        def graph_label(tex: str) -> Tex:
            label = Tex(tex, font_size=32)
            label.set_color(RED_C)
            label.move_to(lable_position)
            return label
        func_label = graph_label('S=(t-4)^2+2')
        func_label_mid = graph_label('S=a(t-4)^2+2')
        func_label_orig = graph_label('S=a(t-h)^2+k')

        self.wait()
        self.play(FadeIn(geometry_graph, DOWN), Write(axes2), run_time=3)
        self.wait(3)

        self.play(ShowCreation(function_graph))
        self.wait()
        self.play(Write(func_label_orig))
        self.wait()
        self.play(ReplacementTransform(func_label_orig, func_label_mid))
        self.wait()
        self.play(ReplacementTransform(func_label_mid, func_label))
        self.wait(3)

Error:

The final scene to be like this: faded out lines and dashed curves

Environment

OS System: Windows 11 22H2 22621.1265 manim version: master after pypi ver uninstalled python version: Python 3.11.1 Graph card: HD4400

mathematics128 commented 1 year ago

This problem has nothing to do with the old ver manimgl... I completely re installed my python environment and the problem still exists.