From 05a1e5b17fd23b60ff7d5ae701bd11c8e3df28fd Mon Sep 17 00:00:00 2001 From: SASHAKT1290 Date: Sat, 25 Oct 2025 00:51:06 +0530 Subject: [PATCH 1/2] swapped height and width values --- manim/cli/init/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/cli/init/commands.py b/manim/cli/init/commands.py index e955949964..d0ecfaf7ab 100644 --- a/manim/cli/init/commands.py +++ b/manim/cli/init/commands.py @@ -29,7 +29,7 @@ "background_color": "BLACK", "background_opacity": 1, "scene_names": "Default", - "resolution": (480, 854), + "resolution": (1920, 1080), } __all__ = ["select_resolution", "update_cfg", "project", "scene"] From 31d2a773321bf1f95f8e52c823cf52348719a299 Mon Sep 17 00:00:00 2001 From: SASHAKT1290 Date: Sat, 25 Oct 2025 00:56:36 +0530 Subject: [PATCH 2/2] updated default resolution settings --- manim/mobject/three_d/three_dimensions.py | 9 ++++++-- tests/test_graphical_units/test_threed.py | 25 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/manim/mobject/three_d/three_dimensions.py b/manim/mobject/three_d/three_dimensions.py index 161b86dc8f..ccbc4dea91 100644 --- a/manim/mobject/three_d/three_dimensions.py +++ b/manim/mobject/three_d/three_dimensions.py @@ -936,6 +936,10 @@ def __init__( ): self.thickness = thickness self.resolution = (2, resolution) if isinstance(resolution, int) else resolution + + start = np.array(start, dtype=np.float64) + end = np.array(end, dtype=np.float64) + self.set_start_and_end_attrs(start, end, **kwargs) if color is not None: self.set_color(color) @@ -1193,8 +1197,9 @@ def __init__( height=height, **kwargs, ) - self.cone.shift(end) - self.end_point = VectorizedPoint(end) + np_end = np.asarray(end, dtype=np.float64) + self.cone.shift(np_end) + self.end_point = VectorizedPoint(np_end) self.add(self.end_point, self.cone) self.set_color(color) diff --git a/tests/test_graphical_units/test_threed.py b/tests/test_graphical_units/test_threed.py index dc52b0dd9e..108472f840 100644 --- a/tests/test_graphical_units/test_threed.py +++ b/tests/test_graphical_units/test_threed.py @@ -164,7 +164,7 @@ def param_surface(u, v): def test_get_start_and_end_Arrow3d(): - start, end = ORIGIN, np.array([2, 1, 0]) + start, end = ORIGIN, np.array([2, 1, 0], dtype=np.float64) arrow = Arrow3D(start, end) assert np.allclose(arrow.get_start(), start, atol=0.01), ( "start points of Arrow3D do not match" @@ -172,3 +172,26 @@ def test_get_start_and_end_Arrow3d(): assert np.allclose(arrow.get_end(), end, atol=0.01), ( "end points of Arrow3D do not match" ) + + +def test_type_conversion_in_Line3D(): + start, end = [0, 0, 0], [1, 1, 1] + line = Line3D(start, end) + type_table = [type(item) for item in [*line.get_start(), *line.get_end()]] + bool_table = [t == np.float64 for t in type_table] + assert all(bool_table), "Types of start and end points are not np.float64" + + +def test_type_conversion_in_Arrow3D(): + start, end = [0, 0, 0], [1, 1, 1] + arrow = Arrow3D(start, end) + type_table = [type(item) for item in [*arrow.get_start(), *arrow.get_end()]] + bool_table = [t == np.float64 for t in type_table] + assert all(bool_table), "Types of start and end points are not np.float64" + + assert np.allclose(arrow.get_start(), start, atol=0.01), ( + "start points of Arrow3D do not match" + ) + assert np.allclose(arrow.get_end(), end, atol=0.01), ( + "end points of Arrow3D do not match" + )