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 <49853152+chopan050@users.noreply.github.com>
This commit is contained in:
yang-tsao 2024-06-10 20:07:20 +08:00 committed by GitHub
commit c2fa4f926b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1223,8 +1223,8 @@ class OpenGLVMobject(OpenGLMobject):
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)