From 2532530117b74b034a65d0ef2875a4051c21e81d Mon Sep 17 00:00:00 2001 From: yang-tsao Date: Wed, 29 May 2024 20:54:45 +0800 Subject: [PATCH] Update opengl_vectorized_mobject.py The "insert_n_curves_to_point_list" function requires the "points" argument to be a numpy array, since it calls the "get_bezier_tuples_from_points" function, which requires "points" to be a numpy array because it has the "return points.reshape((-1, nppc, 3))" statement. Ordinary lists do not have a "reshape" method. So we need to convert "sp1" and "sp2" to numpy arrays before calling the "insert_n_curves_to_point_list" function. --- manim/mobject/opengl/opengl_vectorized_mobject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manim/mobject/opengl/opengl_vectorized_mobject.py b/manim/mobject/opengl/opengl_vectorized_mobject.py index b7b5d4ce54..2380d6d805 100644 --- a/manim/mobject/opengl/opengl_vectorized_mobject.py +++ b/manim/mobject/opengl/opengl_vectorized_mobject.py @@ -1223,8 +1223,8 @@ def get_nth_subpath(path_list, n): return path for n in range(n_subpaths): - sp1 = get_nth_subpath(subpaths1, n) - sp2 = get_nth_subpath(subpaths2, n) + sp1 = np.asarray(get_nth_subpath(subpaths1, n)) + sp2 = np.asarray(get_nth_subpath(subpaths2, n)) diff1 = max(0, (len(sp2) - len(sp1)) // nppc) diff2 = max(0, (len(sp1) - len(sp2)) // nppc) sp1 = self.insert_n_curves_to_point_list(diff1, sp1)