3b1b / manim

Animation engine for explanatory math videos
MIT License
62.93k stars 5.83k forks source link

Some curves rendered as straight lines #1407

Open andreubotella opened 3 years ago

andreubotella commented 3 years ago

Describe the bug

Some of the teacher's curves in med_test's AskWhatTheParadoxIs are instead rendered as straight lines.

Code: PYTHONPATH="$(pwd):$PYTHONPATH" manimgl -w _2020/med_test.py AskWhatTheParadoxIs (on a clone of https://github.com/3b1b/videos)

Wrong display or Error traceback:

Screenshot from AskWhatTheParadoxIs mp4

Additional context

From a bisection, it seems the bug was introduced in commit d4c89e52, and from further testing it looks like the bug stems from VMobject.flip no longer calling refresh_unit_normal every time (since the triggers_refreshed_triangulation decorator only calls it when the points have changed).

andreubotella commented 3 years ago

The same commit also introduced similar artifacts in the teacher's mouth that doesn't go away by merely fixing flip to call self.refresh_unit_normal() every time:

image

This artifact was apparently introduced when adding the call to self.refresh_unit_normal() (again, as part of the triggers_refreshed_triangulation decorator) to the set_data method.