Skip to content

Commit c2fa4f9

Browse files
yang-tsaochopan050
andauthored
Update opengl_vectorized_mobject.py (#3790)
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. Co-authored-by: Francisco Manríquez Novoa <[email protected]>
1 parent e30ed6e commit c2fa4f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

manim/mobject/opengl/opengl_vectorized_mobject.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,8 @@ def get_nth_subpath(path_list, n):
12231223
return path
12241224

12251225
for n in range(n_subpaths):
1226-
sp1 = get_nth_subpath(subpaths1, n)
1227-
sp2 = get_nth_subpath(subpaths2, n)
1226+
sp1 = np.asarray(get_nth_subpath(subpaths1, n))
1227+
sp2 = np.asarray(get_nth_subpath(subpaths2, n))
12281228
diff1 = max(0, (len(sp2) - len(sp1)) // nppc)
12291229
diff2 = max(0, (len(sp1) - len(sp2)) // nppc)
12301230
sp1 = self.insert_n_curves_to_point_list(diff1, sp1)

0 commit comments

Comments
 (0)