geom.py 文件源码

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

项目:Sverchok 作者: Sverchok 项目源码 文件源码
def eval(self, t_in):
        """
        Evaluate the spline at the points in t_in, which must be an array
        with values in [0,1]
        returns and np array with the corresponding points
        """
        t_in = t_in.clip(0.0, 1.0)
        splines = self.splines
        tknots = self.tknots
        index = tknots.searchsorted(t_in, side='left') - 1
        index = index.clip(0, len(splines) - 1)
        to_calc = splines[index]
        ax, bx, cx, dx, tx = np.swapaxes(to_calc, 0, 1)
        t_r = t_in[:, np.newaxis] - tx
        out = ax + t_r * (bx + t_r * (cx + t_r * dx))
        return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号