def set_points_uniform_length(self, npoints = None):
"""Resample the curves base points such that the distances between the curve vectors are uniform
Arguments:
npoints (int or None): number of sample points
"""
if npoints is None:
if self._npoints is None:
raise ValueError('cannot determine number of points for uniform sampling!');
npoints = self._npoints;
tck,u = splprep(self.values.T, s = 0);
points = np.linspace(0,1,npoints)
values = splev(points, tck, der = 0, ext = 1);
self.set_values(np.vstack(values).T, points);
评论列表
文章目录