mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
bug fix for resize_with_interpolation in the case of length=0
This commit is contained in:
parent
402c06c99a
commit
5636b41dfd
1 changed files with 2 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue