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
评论列表
文章目录