SplineObject.py 文件源码

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

项目:Splipy 作者: sintefmath 项目源码 文件源码
def lower_periodic(self, periodic, direction=0):
        """  Sets the periodicity of the spline object in the given direction,
        keeping the geometry unchanged.

        :param int periodic: new periodicity, i.e. the basis is C^k over the start/end
        :param int direction: the parametric direction of the basis to modify
        :return: self
        """
        direction = check_direction(direction, self.pardim)

        b  = self.bases[direction]
        while periodic < b.periodic:
            self.insert_knot(self.start(direction), direction)
            self.controlpoints = np.roll(self.controlpoints, -1, direction)
            b.roll(1)
            b.periodic -= 1
            b.knots = b.knots[:-1]
        if periodic > b.periodic:
            raise ValueError('Cannot raise periodicity')

        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号