ManimCommunity/manim

Two lines cleary interssecting raising the error of not interssecting

Open

#1.930 geöffnet am 19. Aug. 2021

Auf GitHub ansehen
 (7 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Python (1.378 Forks)batch import
good first issueissue:bug

Repository-Metriken

Stars
 (17.820 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 90T 10h) (31 gemergte PRs in 30 T)

Beschreibung

Description of bug / unexpected behavior

I'm trying to make an animation where there are two lines and an angle between then, and this angle may change so the lines are constantly updating

But when I run the code it says "ValueError: Lines do not interssect", when the lines clearly interssect

How to reproduce the issue

Here's a code doing a similar thing of what i'm doing on my animation

from manim import *

class RotatingLine(Scene):
    def construct(self):
        theta = ValueTracker(60 * DEGREES)

        base_line = Line(LEFT * 2, RIGHT * 2)

        rotating_line = base_line.copy()
        rotating_line.add_updater(lambda mobj: mobj.become(base_line.copy().rotate(theta.get_value())))
        
        angle = always_redraw(
            lambda: Angle(base_line, rotating_line)
        )

        self.add(base_line, rotating_line, angle)
        self.play(theta.animate.set_value(30 * DEGREES))

Additional media files

Here's what the animation would look like without the angle part, and it's clear that the lines are interssecting

RotatingLine_ManimCE_v0 9 0

Logs

https://pastebin.com/VxfDS7yW

Additional comments

I'm new into coding so at first I thought if this was me not knowing how to do something, but after testing I could see this is not really how this is supposed to work, so any kind of help would be welcome

Contributor Guide