-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
enhancementAdditions and improvements in generalAdditions and improvements in general
Description
Enhancement proposal
The streamlines are always rendered. The cached version is never used. The reason is that the code for StreamLines sets np.random.seed(0)
, the seed for np.random
. However, another radomizer is actualy used. I have several sugestions:
- set the radomizer
random.seed()
as well, or - use only the radomizer from
numpy
to generate streamlines, or - mention the necessity to set the randomizer in documentation.
Additional comments
The following code is from example on manim webpage. Adding the second and third lines speeds up the second and other compilations by a large factor.
from manim import *
import random
random.seed(10)
class ContinuousMotion(Scene):
def construct(self):
func = lambda pos: np.sin(pos[0] / 2) * UR + np.cos(pos[1] / 2) * LEFT
stream_lines = StreamLines(func, stroke_width=2, max_anchors_per_line=30)
self.add(stream_lines)
stream_lines.start_animation(warm_up=False, flow_speed=1.5)
self.wait(stream_lines.virtual_time / stream_lines.flow_speed)
Metadata
Metadata
Assignees
Labels
enhancementAdditions and improvements in generalAdditions and improvements in general
Type
Projects
Status
🆕 New