sandSpline.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:sand-spline 作者: inconvergent 项目源码 文件源码
def __next__(self):
    try:
      g = next(self.guide)
    except Exception:
      raise StopIteration

    pnum = self.pnum

    r = 1.0-2.0*random(pnum)
    self.noise[:] += r*self.scale

    a = random(pnum)*TWOPI
    rnd = column_stack((cos(a), sin(a)))

    self.path += rnd * reshape(self.noise, (self.pnum,1))
    self.interpolated_path = _rnd_interpolate(self.path, self.inum, ordered=ORDERED)

    self.i+=1
    return g + self.interpolated_path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号