diff --git a/manimlib/utils/iterables.py b/manimlib/utils/iterables.py index e7d8fc6a..4fd0582c 100644 --- a/manimlib/utils/iterables.py +++ b/manimlib/utils/iterables.py @@ -98,6 +98,8 @@ def resize_preserving_order(nparray, length): def resize_with_interpolation(nparray, length): if len(nparray) == length: return nparray + if length == 0: + return np.zeros((0, *nparray.shape[1:])) cont_indices = np.linspace(0, len(nparray) - 1, length) return np.array([ (1 - a) * nparray[lh] + a * nparray[rh]