ManimCommunity/manim

Two lines cleary interssecting raising the error of not interssecting

Open

#1,930 创建于 2021年8月19日

在 GitHub 查看
 (7 评论) (0 反应) (1 负责人)Python (1,378 fork)batch import
good first issueissue:bug

仓库指标

Star
 (17,820 star)
PR 合并指标
 (平均合并 90天 10小时) (30 天内合并 31 个 PR)

描述

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

贡献者指南