From 11889540d58f56eef014cd219a38947cf44d310a Mon Sep 17 00:00:00 2001 From: Gregory Ling <17791817+glingy@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:27:43 -0500 Subject: [PATCH 1/2] Add np.array to get_nth_subpath --- manim/mobject/opengl/opengl_vectorized_mobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/mobject/opengl/opengl_vectorized_mobject.py b/manim/mobject/opengl/opengl_vectorized_mobject.py index d270ec6d40..dbd550fb09 100644 --- a/manim/mobject/opengl/opengl_vectorized_mobject.py +++ b/manim/mobject/opengl/opengl_vectorized_mobject.py @@ -1200,7 +1200,7 @@ def align_points(self, vmobject): def get_nth_subpath(path_list, n): if n >= len(path_list): # Create a null path at the very end - return [path_list[-1][-1]] * nppc + return np.array([path_list[-1][-1]] * nppc) path = path_list[n] # Check for useless points at the end of the path and remove them # https://github.com/ManimCommunity/manim/issues/1959 From d026201462514a68c49c824b586297bd882b9162 Mon Sep 17 00:00:00 2001 From: Benjamin Hackl Date: Thu, 27 Jul 2023 15:26:14 +0200 Subject: [PATCH 2/2] added one test for OpenGLVMobject.align_data_and_family --- tests/opengl/test_opengl_vectorized_mobject.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/opengl/test_opengl_vectorized_mobject.py b/tests/opengl/test_opengl_vectorized_mobject.py index 8e0ba22582..01aff2a71f 100644 --- a/tests/opengl/test_opengl_vectorized_mobject.py +++ b/tests/opengl/test_opengl_vectorized_mobject.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from manim import Circle, Line, Square, VDict, VGroup +from manim import Circle, Line, Square, Text, VDict, VGroup from manim.mobject.opengl.opengl_mobject import OpenGLMobject from manim.mobject.opengl.opengl_vectorized_mobject import OpenGLVMobject @@ -32,6 +32,14 @@ def test_opengl_vmobject_point_from_propotion(using_opengl_renderer): obj.point_from_proportion(0) +def test_opengl_align_family_and_data(using_opengl_renderer): + text_c = Text("c") + text_o = Text("o") + assert text_c.get_all_points().shape != text_o.get_all_points().shape + text_c.align_data_and_family(text_o) + assert text_c.get_all_points().shape == text_o.get_all_points().shape + + def test_vgroup_init(using_opengl_renderer): """Test the VGroup instantiation.""" VGroup()