mirror of
https://github.com/3b1b/manim.git
synced 2026-04-26 03:00:23 -04:00
bug fix for resize_with_interpolation in the case of length=0
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user