manim 0.18.1__py3-none-any.whl → 0.19.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of manim might be problematic. Click here for more details.
- manim/__main__.py +45 -12
- manim/_config/__init__.py +2 -2
- manim/_config/cli_colors.py +8 -4
- manim/_config/default.cfg +0 -2
- manim/_config/logger_utils.py +5 -0
- manim/_config/utils.py +29 -38
- manim/animation/animation.py +148 -8
- manim/animation/composition.py +16 -13
- manim/animation/creation.py +184 -8
- manim/animation/fading.py +5 -8
- manim/animation/indication.py +93 -26
- manim/animation/movement.py +21 -3
- manim/animation/rotation.py +2 -1
- manim/animation/specialized.py +3 -5
- manim/animation/speedmodifier.py +3 -3
- manim/animation/transform.py +4 -5
- manim/animation/updaters/mobject_update_utils.py +17 -14
- manim/camera/camera.py +2 -2
- manim/cli/__init__.py +17 -0
- manim/cli/cfg/group.py +52 -36
- manim/cli/checkhealth/checks.py +92 -76
- manim/cli/checkhealth/commands.py +12 -5
- manim/cli/default_group.py +148 -24
- manim/cli/init/commands.py +28 -23
- manim/cli/plugins/commands.py +13 -3
- manim/cli/render/commands.py +47 -42
- manim/cli/render/global_options.py +43 -9
- manim/cli/render/render_options.py +84 -19
- manim/constants.py +11 -4
- manim/mobject/frame.py +0 -1
- manim/mobject/geometry/arc.py +109 -75
- manim/mobject/geometry/boolean_ops.py +20 -17
- manim/mobject/geometry/labeled.py +300 -77
- manim/mobject/geometry/line.py +120 -60
- manim/mobject/geometry/polygram.py +109 -25
- manim/mobject/geometry/shape_matchers.py +35 -15
- manim/mobject/geometry/tips.py +36 -27
- manim/mobject/graph.py +48 -40
- manim/mobject/graphing/coordinate_systems.py +110 -45
- manim/mobject/graphing/functions.py +16 -10
- manim/mobject/graphing/number_line.py +23 -9
- manim/mobject/graphing/probability.py +2 -10
- manim/mobject/graphing/scale.py +6 -5
- manim/mobject/matrix.py +17 -19
- manim/mobject/mobject.py +149 -103
- manim/mobject/opengl/opengl_geometry.py +4 -8
- manim/mobject/opengl/opengl_mobject.py +506 -343
- manim/mobject/opengl/opengl_point_cloud_mobject.py +3 -7
- manim/mobject/opengl/opengl_surface.py +1 -2
- manim/mobject/opengl/opengl_vectorized_mobject.py +27 -65
- manim/mobject/svg/brace.py +61 -13
- manim/mobject/svg/svg_mobject.py +2 -1
- manim/mobject/table.py +11 -12
- manim/mobject/text/code_mobject.py +186 -550
- manim/mobject/text/numbers.py +7 -7
- manim/mobject/text/tex_mobject.py +22 -13
- manim/mobject/text/text_mobject.py +29 -20
- manim/mobject/three_d/polyhedra.py +98 -1
- manim/mobject/three_d/three_dimensions.py +59 -31
- manim/mobject/types/image_mobject.py +37 -23
- manim/mobject/types/point_cloud_mobject.py +103 -67
- manim/mobject/types/vectorized_mobject.py +387 -214
- manim/mobject/value_tracker.py +2 -1
- manim/mobject/vector_field.py +2 -4
- manim/opengl/__init__.py +3 -3
- manim/plugins/__init__.py +2 -3
- manim/plugins/plugins_flags.py +3 -3
- manim/renderer/cairo_renderer.py +11 -11
- manim/renderer/opengl_renderer.py +19 -20
- manim/renderer/shader.py +2 -3
- manim/renderer/shader_wrapper.py +3 -2
- manim/scene/moving_camera_scene.py +23 -0
- manim/scene/scene.py +72 -41
- manim/scene/scene_file_writer.py +313 -164
- manim/scene/section.py +15 -15
- manim/scene/three_d_scene.py +8 -15
- manim/scene/vector_space_scene.py +3 -6
- manim/typing.py +326 -66
- manim/utils/bezier.py +1658 -381
- manim/utils/caching.py +11 -5
- manim/utils/color/AS2700.py +2 -0
- manim/utils/color/BS381.py +2 -0
- manim/utils/color/DVIPSNAMES.py +96 -0
- manim/utils/color/SVGNAMES.py +179 -0
- manim/utils/color/X11.py +3 -0
- manim/utils/color/XKCD.py +2 -0
- manim/utils/color/__init__.py +8 -5
- manim/utils/color/core.py +818 -301
- manim/utils/color/manim_colors.py +7 -9
- manim/utils/commands.py +40 -19
- manim/utils/config_ops.py +18 -13
- manim/utils/debug.py +8 -6
- manim/utils/deprecation.py +92 -43
- manim/utils/docbuild/autoaliasattr_directive.py +45 -8
- manim/utils/docbuild/autocolor_directive.py +12 -13
- manim/utils/docbuild/manim_directive.py +35 -29
- manim/utils/docbuild/module_parsing.py +74 -27
- manim/utils/family.py +3 -3
- manim/utils/family_ops.py +12 -4
- manim/utils/file_ops.py +22 -16
- manim/utils/hashing.py +7 -7
- manim/utils/images.py +10 -4
- manim/utils/ipython_magic.py +12 -8
- manim/utils/iterables.py +161 -119
- manim/utils/module_ops.py +55 -19
- manim/utils/opengl.py +68 -23
- manim/utils/parameter_parsing.py +3 -2
- manim/utils/paths.py +11 -5
- manim/utils/polylabel.py +168 -0
- manim/utils/qhull.py +218 -0
- manim/utils/rate_functions.py +69 -32
- manim/utils/simple_functions.py +24 -15
- manim/utils/sounds.py +7 -1
- manim/utils/space_ops.py +48 -37
- manim/utils/testing/_frames_testers.py +13 -8
- manim/utils/testing/_show_diff.py +5 -3
- manim/utils/testing/_test_class_makers.py +33 -18
- manim/utils/testing/frames_comparison.py +20 -14
- manim/utils/tex.py +4 -2
- manim/utils/tex_file_writing.py +45 -45
- manim/utils/tex_templates.py +1 -1
- manim/utils/unit.py +6 -5
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/METADATA +16 -9
- manim-0.19.0.dist-info/RECORD +221 -0
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/WHEEL +1 -1
- manim-0.18.1.dist-info/RECORD +0 -217
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/LICENSE +0 -0
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/LICENSE.community +0 -0
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/entry_points.txt +0 -0
manim/scene/section.py
CHANGED
|
@@ -34,23 +34,23 @@ class DefaultSectionType(str, Enum):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
class Section:
|
|
37
|
-
"""A :class:`.Scene` can be segmented into multiple Sections.
|
|
37
|
+
r"""A :class:`.Scene` can be segmented into multiple Sections.
|
|
38
38
|
Refer to :doc:`the documentation</tutorials/output_and_config>` for more info.
|
|
39
39
|
It consists of multiple animations.
|
|
40
40
|
|
|
41
41
|
Attributes
|
|
42
42
|
----------
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
type\_
|
|
44
|
+
Can be used by a third party applications to classify different types of sections.
|
|
45
|
+
video
|
|
46
|
+
Path to video file with animations belonging to section relative to sections directory.
|
|
47
|
+
If ``None``, then the section will not be saved.
|
|
48
|
+
name
|
|
49
|
+
Human readable, non-unique name for this section.
|
|
50
|
+
skip_animations
|
|
51
|
+
Skip rendering the animations in this section when ``True``.
|
|
52
|
+
partial_movie_files
|
|
53
|
+
Animations belonging to this section.
|
|
54
54
|
|
|
55
55
|
See Also
|
|
56
56
|
--------
|
|
@@ -59,8 +59,8 @@ class Section:
|
|
|
59
59
|
:meth:`.OpenGLRenderer.update_skipping_status`
|
|
60
60
|
"""
|
|
61
61
|
|
|
62
|
-
def __init__(self,
|
|
63
|
-
self.
|
|
62
|
+
def __init__(self, type_: str, video: str | None, name: str, skip_animations: bool):
|
|
63
|
+
self.type_ = type_
|
|
64
64
|
# None when not to be saved -> still keeps section alive
|
|
65
65
|
self.video: str | None = video
|
|
66
66
|
self.name = name
|
|
@@ -94,7 +94,7 @@ class Section:
|
|
|
94
94
|
return dict(
|
|
95
95
|
{
|
|
96
96
|
"name": self.name,
|
|
97
|
-
"type": self.
|
|
97
|
+
"type": self.type_,
|
|
98
98
|
"video": self.video,
|
|
99
99
|
},
|
|
100
100
|
**video_metadata,
|
manim/scene/three_d_scene.py
CHANGED
|
@@ -6,7 +6,7 @@ __all__ = ["ThreeDScene", "SpecialThreeDScene"]
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
import warnings
|
|
9
|
-
from
|
|
9
|
+
from collections.abc import Iterable, Sequence
|
|
10
10
|
|
|
11
11
|
import numpy as np
|
|
12
12
|
|
|
@@ -86,7 +86,6 @@ class ThreeDScene(Scene):
|
|
|
86
86
|
The new center of the camera frame in cartesian coordinates.
|
|
87
87
|
|
|
88
88
|
"""
|
|
89
|
-
|
|
90
89
|
if phi is not None:
|
|
91
90
|
self.renderer.camera.set_phi(phi)
|
|
92
91
|
if theta is not None:
|
|
@@ -135,13 +134,11 @@ class ThreeDScene(Scene):
|
|
|
135
134
|
}
|
|
136
135
|
cam.add_updater(lambda m, dt: methods[about](rate * dt))
|
|
137
136
|
self.add(self.camera)
|
|
138
|
-
except Exception:
|
|
139
|
-
raise ValueError("Invalid ambient rotation angle.")
|
|
137
|
+
except Exception as e:
|
|
138
|
+
raise ValueError("Invalid ambient rotation angle.") from e
|
|
140
139
|
|
|
141
140
|
def stop_ambient_camera_rotation(self, about="theta"):
|
|
142
|
-
"""
|
|
143
|
-
This method stops all ambient camera rotation.
|
|
144
|
-
"""
|
|
141
|
+
"""This method stops all ambient camera rotation."""
|
|
145
142
|
about: str = about.lower()
|
|
146
143
|
try:
|
|
147
144
|
if config.renderer == RendererType.CAIRO:
|
|
@@ -155,8 +152,8 @@ class ThreeDScene(Scene):
|
|
|
155
152
|
self.remove(x)
|
|
156
153
|
elif config.renderer == RendererType.OPENGL:
|
|
157
154
|
self.camera.clear_updaters()
|
|
158
|
-
except Exception:
|
|
159
|
-
raise ValueError("Invalid ambient rotation angle.")
|
|
155
|
+
except Exception as e:
|
|
156
|
+
raise ValueError("Invalid ambient rotation angle.") from e
|
|
160
157
|
|
|
161
158
|
def begin_3dillusion_camera_rotation(
|
|
162
159
|
self,
|
|
@@ -205,9 +202,7 @@ class ThreeDScene(Scene):
|
|
|
205
202
|
self.add(self.renderer.camera.phi_tracker)
|
|
206
203
|
|
|
207
204
|
def stop_3dillusion_camera_rotation(self):
|
|
208
|
-
"""
|
|
209
|
-
This method stops all illusion camera rotations.
|
|
210
|
-
"""
|
|
205
|
+
"""This method stops all illusion camera rotations."""
|
|
211
206
|
self.renderer.camera.theta_tracker.clear_updaters()
|
|
212
207
|
self.remove(self.renderer.camera.theta_tracker)
|
|
213
208
|
self.renderer.camera.phi_tracker.clear_updaters()
|
|
@@ -545,7 +540,5 @@ class SpecialThreeDScene(ThreeDScene):
|
|
|
545
540
|
return self.default_angled_camera_position
|
|
546
541
|
|
|
547
542
|
def set_camera_to_default_position(self):
|
|
548
|
-
"""
|
|
549
|
-
Sets the camera to its default position.
|
|
550
|
-
"""
|
|
543
|
+
"""Sets the camera to its default position."""
|
|
551
544
|
self.set_camera_orientation(**self.default_angled_camera_position)
|
|
@@ -297,7 +297,7 @@ class VectorScene(Scene):
|
|
|
297
297
|
"""
|
|
298
298
|
if not isinstance(label, MathTex):
|
|
299
299
|
if len(label) == 1:
|
|
300
|
-
label = "\\vec{\\textbf{%s}}" % label
|
|
300
|
+
label = "\\vec{\\textbf{%s}}" % label # noqa: UP031
|
|
301
301
|
label = MathTex(label)
|
|
302
302
|
if color is None:
|
|
303
303
|
color = vector.get_color()
|
|
@@ -904,9 +904,8 @@ class LinearTransformationScene(VectorScene):
|
|
|
904
904
|
if new_label:
|
|
905
905
|
label_mob.target_text = new_label
|
|
906
906
|
else:
|
|
907
|
-
label_mob.target_text =
|
|
908
|
-
transformation_name
|
|
909
|
-
label_mob.get_tex_string(),
|
|
907
|
+
label_mob.target_text = (
|
|
908
|
+
f"{transformation_name}({label_mob.get_tex_string()})"
|
|
910
909
|
)
|
|
911
910
|
label_mob.vector = vector
|
|
912
911
|
label_mob.kwargs = kwargs
|
|
@@ -1003,7 +1002,6 @@ class LinearTransformationScene(VectorScene):
|
|
|
1003
1002
|
Animation
|
|
1004
1003
|
The animation of the movement.
|
|
1005
1004
|
"""
|
|
1006
|
-
|
|
1007
1005
|
v_pieces = [piece for piece in pieces if isinstance(piece, VMobject)]
|
|
1008
1006
|
start = VGroup(*v_pieces)
|
|
1009
1007
|
target = VGroup(*(mob.target for mob in v_pieces))
|
|
@@ -1094,7 +1092,6 @@ class LinearTransformationScene(VectorScene):
|
|
|
1094
1092
|
**kwargs
|
|
1095
1093
|
Any valid keyword argument of self.apply_transposed_matrix()
|
|
1096
1094
|
"""
|
|
1097
|
-
|
|
1098
1095
|
self.apply_transposed_matrix(np.array(matrix).T, **kwargs)
|
|
1099
1096
|
|
|
1100
1097
|
def apply_inverse(self, matrix: np.ndarray | list | tuple, **kwargs):
|