manim 0.18.0__py3-none-any.whl → 0.18.1__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/__init__.py +3 -6
- manim/__main__.py +18 -10
- manim/_config/__init__.py +5 -2
- manim/_config/cli_colors.py +12 -8
- manim/_config/default.cfg +1 -1
- manim/_config/logger_utils.py +9 -8
- manim/_config/utils.py +637 -449
- manim/animation/animation.py +9 -2
- manim/animation/composition.py +78 -40
- manim/animation/creation.py +12 -6
- manim/animation/fading.py +0 -1
- manim/animation/indication.py +10 -21
- manim/animation/movement.py +1 -2
- manim/animation/rotation.py +1 -1
- manim/animation/specialized.py +1 -1
- manim/animation/speedmodifier.py +7 -2
- manim/animation/transform_matching_parts.py +1 -1
- manim/camera/camera.py +13 -4
- manim/cli/cfg/group.py +18 -8
- manim/cli/checkhealth/checks.py +2 -0
- manim/cli/checkhealth/commands.py +2 -0
- manim/cli/default_group.py +13 -5
- manim/cli/init/commands.py +4 -1
- manim/cli/plugins/commands.py +3 -0
- manim/cli/render/commands.py +27 -20
- manim/cli/render/ease_of_access_options.py +4 -3
- manim/cli/render/global_options.py +9 -7
- manim/cli/render/output_options.py +6 -5
- manim/cli/render/render_options.py +13 -13
- manim/constants.py +54 -15
- manim/gui/gui.py +2 -0
- manim/mobject/geometry/arc.py +4 -4
- manim/mobject/geometry/boolean_ops.py +13 -9
- manim/mobject/geometry/line.py +16 -8
- manim/mobject/geometry/polygram.py +17 -5
- manim/mobject/geometry/tips.py +2 -2
- manim/mobject/graph.py +379 -106
- manim/mobject/graphing/coordinate_systems.py +17 -20
- manim/mobject/graphing/functions.py +14 -10
- manim/mobject/graphing/number_line.py +1 -1
- manim/mobject/mobject.py +175 -72
- manim/mobject/opengl/opengl_compatibility.py +2 -0
- manim/mobject/opengl/opengl_geometry.py +26 -1
- manim/mobject/opengl/opengl_image_mobject.py +2 -0
- manim/mobject/opengl/opengl_mobject.py +3 -0
- manim/mobject/opengl/opengl_point_cloud_mobject.py +2 -0
- manim/mobject/opengl/opengl_surface.py +2 -0
- manim/mobject/opengl/opengl_three_dimensions.py +2 -0
- manim/mobject/opengl/opengl_vectorized_mobject.py +19 -14
- manim/mobject/svg/brace.py +2 -0
- manim/mobject/svg/svg_mobject.py +10 -12
- manim/mobject/table.py +0 -1
- manim/mobject/text/code_mobject.py +2 -0
- manim/mobject/text/numbers.py +2 -0
- manim/mobject/text/tex_mobject.py +1 -1
- manim/mobject/text/text_mobject.py +43 -6
- manim/mobject/three_d/three_d_utils.py +4 -4
- manim/mobject/three_d/three_dimensions.py +4 -4
- manim/mobject/types/image_mobject.py +5 -1
- manim/mobject/types/point_cloud_mobject.py +2 -0
- manim/mobject/types/vectorized_mobject.py +124 -29
- manim/mobject/value_tracker.py +3 -3
- manim/mobject/vector_field.py +3 -1
- manim/plugins/__init__.py +15 -1
- manim/plugins/plugins_flags.py +11 -5
- manim/renderer/cairo_renderer.py +12 -2
- manim/renderer/opengl_renderer.py +2 -3
- manim/renderer/opengl_renderer_window.py +2 -0
- manim/renderer/shader_wrapper.py +2 -0
- manim/renderer/vectorized_mobject_rendering.py +5 -0
- manim/scene/scene.py +22 -6
- manim/scene/scene_file_writer.py +3 -1
- manim/scene/section.py +2 -0
- manim/scene/three_d_scene.py +5 -6
- manim/scene/vector_space_scene.py +21 -5
- manim/typing.py +567 -67
- manim/utils/bezier.py +9 -18
- manim/utils/caching.py +2 -0
- manim/utils/color/BS381.py +1 -0
- manim/utils/color/XKCD.py +1 -0
- manim/utils/color/core.py +31 -13
- manim/utils/commands.py +8 -1
- manim/utils/debug.py +0 -1
- manim/utils/deprecation.py +3 -2
- manim/utils/docbuild/__init__.py +17 -0
- manim/utils/docbuild/autoaliasattr_directive.py +197 -0
- manim/utils/docbuild/autocolor_directive.py +9 -4
- manim/utils/docbuild/manim_directive.py +18 -9
- manim/utils/docbuild/module_parsing.py +198 -0
- manim/utils/exceptions.py +6 -0
- manim/utils/family.py +2 -0
- manim/utils/family_ops.py +5 -0
- manim/utils/file_ops.py +6 -2
- manim/utils/hashing.py +2 -0
- manim/utils/ipython_magic.py +2 -0
- manim/utils/module_ops.py +2 -0
- manim/utils/opengl.py +14 -0
- manim/utils/parameter_parsing.py +31 -0
- manim/utils/paths.py +12 -20
- manim/utils/rate_functions.py +6 -8
- manim/utils/space_ops.py +81 -36
- manim/utils/testing/__init__.py +17 -0
- manim/utils/testing/frames_comparison.py +7 -5
- manim/utils/tex.py +124 -196
- manim/utils/tex_file_writing.py +2 -0
- manim/utils/tex_templates.py +1 -0
- {manim-0.18.0.dist-info → manim-0.18.1.dist-info}/LICENSE.community +1 -1
- {manim-0.18.0.dist-info → manim-0.18.1.dist-info}/METADATA +29 -35
- {manim-0.18.0.dist-info → manim-0.18.1.dist-info}/RECORD +112 -112
- {manim-0.18.0.dist-info → manim-0.18.1.dist-info}/WHEEL +1 -1
- manim/cli/new/__init__.py +0 -0
- manim/cli/new/group.py +0 -189
- manim/plugins/import_plugins.py +0 -43
- {manim-0.18.0.dist-info → manim-0.18.1.dist-info}/LICENSE +0 -0
- {manim-0.18.0.dist-info → manim-0.18.1.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"""Mobjects that represent coordinate systems."""
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
from __future__ import annotations
|
|
5
4
|
|
|
6
5
|
__all__ = [
|
|
@@ -55,7 +54,7 @@ from manim.utils.space_ops import angle_of_vector
|
|
|
55
54
|
|
|
56
55
|
if TYPE_CHECKING:
|
|
57
56
|
from manim.mobject.mobject import Mobject
|
|
58
|
-
from manim.typing import ManimFloat, Point2D, Point3D,
|
|
57
|
+
from manim.typing import ManimFloat, Point2D, Point3D, Vector3D
|
|
59
58
|
|
|
60
59
|
LineType = TypeVar("LineType", bound=Line)
|
|
61
60
|
|
|
@@ -305,7 +304,7 @@ class CoordinateSystem:
|
|
|
305
304
|
label
|
|
306
305
|
The label. Defaults to :class:`~.MathTex` for ``str`` and ``float`` inputs.
|
|
307
306
|
edge
|
|
308
|
-
The edge of the
|
|
307
|
+
The edge of the y-axis to which the label will be added, by default ``UR``.
|
|
309
308
|
direction
|
|
310
309
|
Allows for further positioning of the label from an edge, by default ``UR``
|
|
311
310
|
buff
|
|
@@ -441,8 +440,7 @@ class CoordinateSystem:
|
|
|
441
440
|
line_config: dict | None = ...,
|
|
442
441
|
color: ParsableManimColor | None = ...,
|
|
443
442
|
stroke_width: float = ...,
|
|
444
|
-
) -> DashedLine:
|
|
445
|
-
...
|
|
443
|
+
) -> DashedLine: ...
|
|
446
444
|
|
|
447
445
|
@overload
|
|
448
446
|
def get_line_from_axis_to_point(
|
|
@@ -453,8 +451,7 @@ class CoordinateSystem:
|
|
|
453
451
|
line_config: dict | None = ...,
|
|
454
452
|
color: ParsableManimColor | None = ...,
|
|
455
453
|
stroke_width: float = ...,
|
|
456
|
-
) -> LineType:
|
|
457
|
-
...
|
|
454
|
+
) -> LineType: ...
|
|
458
455
|
|
|
459
456
|
def get_line_from_axis_to_point( # type: ignore[no-untyped-def]
|
|
460
457
|
self,
|
|
@@ -855,9 +852,11 @@ class CoordinateSystem:
|
|
|
855
852
|
function: Callable[[float], float],
|
|
856
853
|
u_range: Sequence[float] | None = None,
|
|
857
854
|
v_range: Sequence[float] | None = None,
|
|
858
|
-
colorscale:
|
|
859
|
-
|
|
860
|
-
|
|
855
|
+
colorscale: (
|
|
856
|
+
Sequence[ParsableManimColor]
|
|
857
|
+
| Sequence[tuple[ParsableManimColor, float]]
|
|
858
|
+
| None
|
|
859
|
+
) = None,
|
|
861
860
|
colorscale_axis: int = 2,
|
|
862
861
|
**kwargs: Any,
|
|
863
862
|
) -> Surface | OpenGLSurface:
|
|
@@ -2342,7 +2341,7 @@ class ThreeDAxes(Axes):
|
|
|
2342
2341
|
y_length: float | None = config.frame_height + 2.5,
|
|
2343
2342
|
z_length: float | None = config.frame_height - 1.5,
|
|
2344
2343
|
z_axis_config: dict[str, Any] | None = None,
|
|
2345
|
-
z_normal:
|
|
2344
|
+
z_normal: Vector3D = DOWN,
|
|
2346
2345
|
num_axis_pieces: int = 20,
|
|
2347
2346
|
light_source: Sequence[float] = 9 * DOWN + 7 * LEFT + 10 * OUT,
|
|
2348
2347
|
# opengl stuff (?)
|
|
@@ -2433,7 +2432,7 @@ class ThreeDAxes(Axes):
|
|
|
2433
2432
|
direction: Sequence[float] = UR,
|
|
2434
2433
|
buff: float = SMALL_BUFF,
|
|
2435
2434
|
rotation: float = PI / 2,
|
|
2436
|
-
rotation_axis:
|
|
2435
|
+
rotation_axis: Vector3D = OUT,
|
|
2437
2436
|
**kwargs,
|
|
2438
2437
|
) -> Mobject:
|
|
2439
2438
|
"""Generate a y-axis label.
|
|
@@ -2480,11 +2479,11 @@ class ThreeDAxes(Axes):
|
|
|
2480
2479
|
def get_z_axis_label(
|
|
2481
2480
|
self,
|
|
2482
2481
|
label: float | str | Mobject,
|
|
2483
|
-
edge:
|
|
2484
|
-
direction:
|
|
2482
|
+
edge: Vector3D = OUT,
|
|
2483
|
+
direction: Vector3D = RIGHT,
|
|
2485
2484
|
buff: float = SMALL_BUFF,
|
|
2486
2485
|
rotation: float = PI / 2,
|
|
2487
|
-
rotation_axis:
|
|
2486
|
+
rotation_axis: Vector3D = RIGHT,
|
|
2488
2487
|
**kwargs: Any,
|
|
2489
2488
|
) -> Mobject:
|
|
2490
2489
|
"""Generate a z-axis label.
|
|
@@ -2571,7 +2570,7 @@ class ThreeDAxes(Axes):
|
|
|
2571
2570
|
self.set_camera_orientation(phi=2*PI/5, theta=PI/5)
|
|
2572
2571
|
axes = ThreeDAxes()
|
|
2573
2572
|
labels = axes.get_axis_labels(
|
|
2574
|
-
|
|
2573
|
+
Text("x-axis").scale(0.7), Text("y-axis").scale(0.45), Text("z-axis").scale(0.45)
|
|
2575
2574
|
)
|
|
2576
2575
|
self.add(axes, labels)
|
|
2577
2576
|
"""
|
|
@@ -2653,14 +2652,12 @@ class NumberPlane(Axes):
|
|
|
2653
2652
|
|
|
2654
2653
|
def __init__(
|
|
2655
2654
|
self,
|
|
2656
|
-
x_range: Sequence[float]
|
|
2657
|
-
| None = (
|
|
2655
|
+
x_range: Sequence[float] | None = (
|
|
2658
2656
|
-config["frame_x_radius"],
|
|
2659
2657
|
config["frame_x_radius"],
|
|
2660
2658
|
1,
|
|
2661
2659
|
),
|
|
2662
|
-
y_range: Sequence[float]
|
|
2663
|
-
| None = (
|
|
2660
|
+
y_range: Sequence[float] | None = (
|
|
2664
2661
|
-config["frame_y_radius"],
|
|
2665
2662
|
config["frame_y_radius"],
|
|
2666
2663
|
1,
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
__all__ = ["ParametricFunction", "FunctionGraph", "ImplicitFunction"]
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
from typing import Callable, Iterable, Sequence
|
|
8
|
+
from typing import TYPE_CHECKING, Callable, Iterable, Sequence
|
|
9
9
|
|
|
10
10
|
import numpy as np
|
|
11
11
|
from isosurfaces import plot_isoline
|
|
@@ -14,6 +14,10 @@ from manim import config
|
|
|
14
14
|
from manim.mobject.graphing.scale import LinearBase, _ScaleBase
|
|
15
15
|
from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL
|
|
16
16
|
from manim.mobject.types.vectorized_mobject import VMobject
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from manim.typing import Point2D, Point3D
|
|
20
|
+
|
|
17
21
|
from manim.utils.color import YELLOW
|
|
18
22
|
|
|
19
23
|
|
|
@@ -23,9 +27,9 @@ class ParametricFunction(VMobject, metaclass=ConvertToOpenGL):
|
|
|
23
27
|
Parameters
|
|
24
28
|
----------
|
|
25
29
|
function
|
|
26
|
-
The function to be plotted in the form of ``(lambda
|
|
30
|
+
The function to be plotted in the form of ``(lambda t: (x(t), y(t), z(t)))``
|
|
27
31
|
t_range
|
|
28
|
-
Determines the length that the function spans. By default ``[0, 1]``
|
|
32
|
+
Determines the length that the function spans in the form of (t_min, t_max, step=0.01). By default ``[0, 1]``
|
|
29
33
|
scaling
|
|
30
34
|
Scaling class applied to the points of the function. Default of :class:`~.LinearBase`.
|
|
31
35
|
use_smoothing
|
|
@@ -49,10 +53,10 @@ class ParametricFunction(VMobject, metaclass=ConvertToOpenGL):
|
|
|
49
53
|
|
|
50
54
|
class PlotParametricFunction(Scene):
|
|
51
55
|
def func(self, t):
|
|
52
|
-
return
|
|
56
|
+
return (np.sin(2 * t), np.sin(3 * t), 0)
|
|
53
57
|
|
|
54
58
|
def construct(self):
|
|
55
|
-
func = ParametricFunction(self.func, t_range =
|
|
59
|
+
func = ParametricFunction(self.func, t_range = (0, TAU), fill_opacity=0).set_color(RED)
|
|
56
60
|
self.add(func.scale(3))
|
|
57
61
|
|
|
58
62
|
.. manim:: ThreeDParametricSpring
|
|
@@ -61,11 +65,11 @@ class ParametricFunction(VMobject, metaclass=ConvertToOpenGL):
|
|
|
61
65
|
class ThreeDParametricSpring(ThreeDScene):
|
|
62
66
|
def construct(self):
|
|
63
67
|
curve1 = ParametricFunction(
|
|
64
|
-
lambda u:
|
|
68
|
+
lambda u: (
|
|
65
69
|
1.2 * np.cos(u),
|
|
66
70
|
1.2 * np.sin(u),
|
|
67
71
|
u * 0.05
|
|
68
|
-
|
|
72
|
+
), color=RED, t_range = (-3*TAU, 5*TAU, 0.01)
|
|
69
73
|
).set_shade_in_3d(True)
|
|
70
74
|
axes = ThreeDAxes()
|
|
71
75
|
self.add(axes, curve1)
|
|
@@ -97,8 +101,8 @@ class ParametricFunction(VMobject, metaclass=ConvertToOpenGL):
|
|
|
97
101
|
|
|
98
102
|
def __init__(
|
|
99
103
|
self,
|
|
100
|
-
function: Callable[[float
|
|
101
|
-
t_range:
|
|
104
|
+
function: Callable[[float], Point3D],
|
|
105
|
+
t_range: Point2D | Point3D = (0, 1),
|
|
102
106
|
scaling: _ScaleBase = LinearBase(),
|
|
103
107
|
dt: float = 1e-8,
|
|
104
108
|
discontinuities: Iterable[float] | None = None,
|
|
@@ -107,7 +111,7 @@ class ParametricFunction(VMobject, metaclass=ConvertToOpenGL):
|
|
|
107
111
|
**kwargs,
|
|
108
112
|
):
|
|
109
113
|
self.function = function
|
|
110
|
-
t_range =
|
|
114
|
+
t_range = (0, 1, 0.01) if t_range is None else t_range
|
|
111
115
|
if len(t_range) == 2:
|
|
112
116
|
t_range = np.array([*t_range, 0.01])
|
|
113
117
|
|
|
@@ -475,7 +475,7 @@ class NumberLine(Line):
|
|
|
475
475
|
num_mob.next_to(self.number_to_point(x), direction=direction, buff=buff)
|
|
476
476
|
if x < 0 and self.label_direction[0] == 0:
|
|
477
477
|
# Align without the minus sign
|
|
478
|
-
num_mob.shift(num_mob[0].
|
|
478
|
+
num_mob.shift(num_mob[0].width * LEFT / 2)
|
|
479
479
|
return num_mob
|
|
480
480
|
|
|
481
481
|
def get_number_mobjects(self, *numbers, **kwargs) -> VGroup:
|