我最近意识到numpy上的随机函数在 a 中使用时总是给出相同的值Scene
,如下例所示:
from manimlib.imports import *
def r():
return np.random.rand(5)
class MyScene(Scene):
def construct(self):
print(r())
将一遍又一遍地给出相同的值:
manim foo.py MyScene -p
...
[0.5488135 0.71518937 0.60276338 0.54488318 0.4236548 ]