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.

Files changed (129) hide show
  1. manim/__main__.py +45 -12
  2. manim/_config/__init__.py +2 -2
  3. manim/_config/cli_colors.py +8 -4
  4. manim/_config/default.cfg +0 -2
  5. manim/_config/logger_utils.py +5 -0
  6. manim/_config/utils.py +29 -38
  7. manim/animation/animation.py +148 -8
  8. manim/animation/composition.py +16 -13
  9. manim/animation/creation.py +184 -8
  10. manim/animation/fading.py +5 -8
  11. manim/animation/indication.py +93 -26
  12. manim/animation/movement.py +21 -3
  13. manim/animation/rotation.py +2 -1
  14. manim/animation/specialized.py +3 -5
  15. manim/animation/speedmodifier.py +3 -3
  16. manim/animation/transform.py +4 -5
  17. manim/animation/updaters/mobject_update_utils.py +17 -14
  18. manim/camera/camera.py +2 -2
  19. manim/cli/__init__.py +17 -0
  20. manim/cli/cfg/group.py +52 -36
  21. manim/cli/checkhealth/checks.py +92 -76
  22. manim/cli/checkhealth/commands.py +12 -5
  23. manim/cli/default_group.py +148 -24
  24. manim/cli/init/commands.py +28 -23
  25. manim/cli/plugins/commands.py +13 -3
  26. manim/cli/render/commands.py +47 -42
  27. manim/cli/render/global_options.py +43 -9
  28. manim/cli/render/render_options.py +84 -19
  29. manim/constants.py +11 -4
  30. manim/mobject/frame.py +0 -1
  31. manim/mobject/geometry/arc.py +109 -75
  32. manim/mobject/geometry/boolean_ops.py +20 -17
  33. manim/mobject/geometry/labeled.py +300 -77
  34. manim/mobject/geometry/line.py +120 -60
  35. manim/mobject/geometry/polygram.py +109 -25
  36. manim/mobject/geometry/shape_matchers.py +35 -15
  37. manim/mobject/geometry/tips.py +36 -27
  38. manim/mobject/graph.py +48 -40
  39. manim/mobject/graphing/coordinate_systems.py +110 -45
  40. manim/mobject/graphing/functions.py +16 -10
  41. manim/mobject/graphing/number_line.py +23 -9
  42. manim/mobject/graphing/probability.py +2 -10
  43. manim/mobject/graphing/scale.py +6 -5
  44. manim/mobject/matrix.py +17 -19
  45. manim/mobject/mobject.py +149 -103
  46. manim/mobject/opengl/opengl_geometry.py +4 -8
  47. manim/mobject/opengl/opengl_mobject.py +506 -343
  48. manim/mobject/opengl/opengl_point_cloud_mobject.py +3 -7
  49. manim/mobject/opengl/opengl_surface.py +1 -2
  50. manim/mobject/opengl/opengl_vectorized_mobject.py +27 -65
  51. manim/mobject/svg/brace.py +61 -13
  52. manim/mobject/svg/svg_mobject.py +2 -1
  53. manim/mobject/table.py +11 -12
  54. manim/mobject/text/code_mobject.py +186 -550
  55. manim/mobject/text/numbers.py +7 -7
  56. manim/mobject/text/tex_mobject.py +22 -13
  57. manim/mobject/text/text_mobject.py +29 -20
  58. manim/mobject/three_d/polyhedra.py +98 -1
  59. manim/mobject/three_d/three_dimensions.py +59 -31
  60. manim/mobject/types/image_mobject.py +37 -23
  61. manim/mobject/types/point_cloud_mobject.py +103 -67
  62. manim/mobject/types/vectorized_mobject.py +387 -214
  63. manim/mobject/value_tracker.py +2 -1
  64. manim/mobject/vector_field.py +2 -4
  65. manim/opengl/__init__.py +3 -3
  66. manim/plugins/__init__.py +2 -3
  67. manim/plugins/plugins_flags.py +3 -3
  68. manim/renderer/cairo_renderer.py +11 -11
  69. manim/renderer/opengl_renderer.py +19 -20
  70. manim/renderer/shader.py +2 -3
  71. manim/renderer/shader_wrapper.py +3 -2
  72. manim/scene/moving_camera_scene.py +23 -0
  73. manim/scene/scene.py +72 -41
  74. manim/scene/scene_file_writer.py +313 -164
  75. manim/scene/section.py +15 -15
  76. manim/scene/three_d_scene.py +8 -15
  77. manim/scene/vector_space_scene.py +3 -6
  78. manim/typing.py +326 -66
  79. manim/utils/bezier.py +1658 -381
  80. manim/utils/caching.py +11 -5
  81. manim/utils/color/AS2700.py +2 -0
  82. manim/utils/color/BS381.py +2 -0
  83. manim/utils/color/DVIPSNAMES.py +96 -0
  84. manim/utils/color/SVGNAMES.py +179 -0
  85. manim/utils/color/X11.py +3 -0
  86. manim/utils/color/XKCD.py +2 -0
  87. manim/utils/color/__init__.py +8 -5
  88. manim/utils/color/core.py +818 -301
  89. manim/utils/color/manim_colors.py +7 -9
  90. manim/utils/commands.py +40 -19
  91. manim/utils/config_ops.py +18 -13
  92. manim/utils/debug.py +8 -6
  93. manim/utils/deprecation.py +92 -43
  94. manim/utils/docbuild/autoaliasattr_directive.py +45 -8
  95. manim/utils/docbuild/autocolor_directive.py +12 -13
  96. manim/utils/docbuild/manim_directive.py +35 -29
  97. manim/utils/docbuild/module_parsing.py +74 -27
  98. manim/utils/family.py +3 -3
  99. manim/utils/family_ops.py +12 -4
  100. manim/utils/file_ops.py +22 -16
  101. manim/utils/hashing.py +7 -7
  102. manim/utils/images.py +10 -4
  103. manim/utils/ipython_magic.py +12 -8
  104. manim/utils/iterables.py +161 -119
  105. manim/utils/module_ops.py +55 -19
  106. manim/utils/opengl.py +68 -23
  107. manim/utils/parameter_parsing.py +3 -2
  108. manim/utils/paths.py +11 -5
  109. manim/utils/polylabel.py +168 -0
  110. manim/utils/qhull.py +218 -0
  111. manim/utils/rate_functions.py +69 -32
  112. manim/utils/simple_functions.py +24 -15
  113. manim/utils/sounds.py +7 -1
  114. manim/utils/space_ops.py +48 -37
  115. manim/utils/testing/_frames_testers.py +13 -8
  116. manim/utils/testing/_show_diff.py +5 -3
  117. manim/utils/testing/_test_class_makers.py +33 -18
  118. manim/utils/testing/frames_comparison.py +20 -14
  119. manim/utils/tex.py +4 -2
  120. manim/utils/tex_file_writing.py +45 -45
  121. manim/utils/tex_templates.py +1 -1
  122. manim/utils/unit.py +6 -5
  123. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/METADATA +16 -9
  124. manim-0.19.0.dist-info/RECORD +221 -0
  125. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/WHEEL +1 -1
  126. manim-0.18.1.dist-info/RECORD +0 -217
  127. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/LICENSE +0 -0
  128. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/LICENSE.community +0 -0
  129. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/entry_points.txt +0 -0
manim/typing.py CHANGED
@@ -20,6 +20,7 @@
20
20
 
21
21
  from __future__ import annotations
22
22
 
23
+ from collections.abc import Sequence
23
24
  from os import PathLike
24
25
  from typing import Callable, Union
25
26
 
@@ -41,16 +42,24 @@ __all__ = [
41
42
  "RGBA_Tuple_Int",
42
43
  "HSV_Array_Float",
43
44
  "HSV_Tuple_Float",
45
+ "HSL_Array_Float",
46
+ "HSL_Tuple_Float",
47
+ "HSVA_Array_Float",
48
+ "HSVA_Tuple_Float",
44
49
  "ManimColorInternal",
45
50
  "PointDType",
46
- "InternalPoint2D",
47
51
  "Point2D",
48
- "InternalPoint2D_Array",
52
+ "Point2DLike",
49
53
  "Point2D_Array",
50
- "InternalPoint3D",
54
+ "Point2DLike_Array",
51
55
  "Point3D",
52
- "InternalPoint3D_Array",
56
+ "Point3DLike",
53
57
  "Point3D_Array",
58
+ "Point3DLike_Array",
59
+ "PointND",
60
+ "PointNDLike",
61
+ "PointND_Array",
62
+ "PointNDLike_Array",
54
63
  "Vector2D",
55
64
  "Vector2D_Array",
56
65
  "Vector3D",
@@ -62,25 +71,38 @@ __all__ = [
62
71
  "MatrixMN",
63
72
  "Zeros",
64
73
  "QuadraticBezierPoints",
74
+ "QuadraticBezierPointsLike",
65
75
  "QuadraticBezierPoints_Array",
76
+ "QuadraticBezierPointsLike_Array",
66
77
  "QuadraticBezierPath",
78
+ "QuadraticBezierPathLike",
67
79
  "QuadraticSpline",
80
+ "QuadraticSplineLike",
68
81
  "CubicBezierPoints",
82
+ "CubicBezierPointsLike",
69
83
  "CubicBezierPoints_Array",
84
+ "CubicBezierPointsLike_Array",
70
85
  "CubicBezierPath",
86
+ "CubicBezierPathLike",
71
87
  "CubicSpline",
88
+ "CubicSplineLike",
72
89
  "BezierPoints",
90
+ "BezierPointsLike",
73
91
  "BezierPoints_Array",
92
+ "BezierPointsLike_Array",
74
93
  "BezierPath",
94
+ "BezierPathLike",
75
95
  "Spline",
96
+ "SplineLike",
76
97
  "FlatBezierPoints",
77
98
  "FunctionOverride",
78
99
  "PathFuncType",
79
100
  "MappingFunction",
80
- "Image",
81
- "GrayscaleImage",
82
- "RGBImage",
83
- "RGBAImage",
101
+ "MultiMappingFunction",
102
+ "PixelArray",
103
+ "GrayscalePixelArray",
104
+ "RGBPixelArray",
105
+ "RGBAPixelArray",
84
106
  "StrPath",
85
107
  "StrOrBytesPath",
86
108
  ]
@@ -215,6 +237,46 @@ Its components describe, in order, the Hue, Saturation and Value (or
215
237
  Brightness) in the represented color.
216
238
  """
217
239
 
240
+ HSVA_Array_Float: TypeAlias = RGBA_Array_Float
241
+ """``shape: (4,)``
242
+
243
+ A :class:`numpy.ndarray` of 4 floats between 0 and 1, representing a
244
+ color in HSVA (or HSBA) format.
245
+
246
+ Its components describe, in order, the Hue, Saturation and Value (or
247
+ Brightness) in the represented color.
248
+ """
249
+
250
+ HSVA_Tuple_Float: TypeAlias = RGBA_Tuple_Float
251
+ """``shape: (4,)``
252
+
253
+ A tuple of 4 floats between 0 and 1, representing a color in HSVA (or
254
+ HSBA) format.
255
+
256
+ Its components describe, in order, the Hue, Saturation and Value (or
257
+ Brightness) in the represented color.
258
+ """
259
+
260
+ HSL_Array_Float: TypeAlias = RGB_Array_Float
261
+ """``shape: (3,)``
262
+
263
+ A :class:`numpy.ndarray` of 3 floats between 0 and 1, representing a
264
+ color in HSL format.
265
+
266
+ Its components describe, in order, the Hue, Saturation and Lightness
267
+ in the represented color.
268
+ """
269
+
270
+ HSL_Tuple_Float: TypeAlias = RGB_Tuple_Float
271
+ """``shape: (3,)``
272
+
273
+ A :class:`numpy.ndarray` of 3 floats between 0 and 1, representing a
274
+ color in HSL format.
275
+
276
+ Its components describe, in order, the Hue, Saturation and Lightness
277
+ in the represented color.
278
+ """
279
+
218
280
  ManimColorInternal: TypeAlias = RGBA_Array_Float
219
281
  """``shape: (4,)``
220
282
 
@@ -237,39 +299,38 @@ PointDType: TypeAlias = ManimFloat
237
299
  floating point value.
238
300
  """
239
301
 
240
- InternalPoint2D: TypeAlias = npt.NDArray[PointDType]
302
+ Point2D: TypeAlias = npt.NDArray[PointDType]
241
303
  """``shape: (2,)``
242
304
 
243
- A 2-dimensional point: ``[float, float]``.
244
-
245
- .. note::
246
- This type alias is mostly made available for internal use, and
247
- only includes the NumPy type.
305
+ A NumPy array representing a 2-dimensional point: ``[float, float]``.
248
306
  """
249
307
 
250
- Point2D: TypeAlias = Union[InternalPoint2D, tuple[float, float]]
308
+ Point2DLike: TypeAlias = Union[Point2D, tuple[float, float]]
251
309
  """``shape: (2,)``
252
310
 
253
311
  A 2-dimensional point: ``[float, float]``.
254
312
 
313
+ This represents anything which can be converted to a :class:`Point2D` NumPy
314
+ array.
315
+
255
316
  Normally, a function or method which expects a `Point2D` as a
256
317
  parameter can handle being passed a `Point3D` instead.
257
318
  """
258
319
 
259
- InternalPoint2D_Array: TypeAlias = npt.NDArray[PointDType]
260
- """``shape: (N, 2)``
261
-
262
- An array of `InternalPoint2D` objects: ``[[float, float], ...]``.
320
+ Point2D_Array: TypeAlias = npt.NDArray[PointDType]
321
+ """``shape: (M, 2)``
263
322
 
264
- .. note::
265
- This type alias is mostly made available for internal use, and
266
- only includes the NumPy type.
323
+ A NumPy array representing a sequence of `Point2D` objects:
324
+ ``[[float, float], ...]``.
267
325
  """
268
326
 
269
- Point2D_Array: TypeAlias = Union[InternalPoint2D_Array, tuple[Point2D, ...]]
270
- """``shape: (N, 2)``
327
+ Point2DLike_Array: TypeAlias = Union[Point2D_Array, Sequence[Point2DLike]]
328
+ """``shape: (M, 2)``
329
+
330
+ An array of `Point2DLike` objects: ``[[float, float], ...]``.
271
331
 
272
- An array of `Point2D` objects: ``[[float, float], ...]``.
332
+ This represents anything which can be converted to a :class:`Point2D_Array`
333
+ NumPy array.
273
334
 
274
335
  Normally, a function or method which expects a `Point2D_Array` as a
275
336
  parameter can handle being passed a `Point3D_Array` instead.
@@ -278,36 +339,69 @@ Please refer to the documentation of the function you are using for
278
339
  further type information.
279
340
  """
280
341
 
281
- InternalPoint3D: TypeAlias = npt.NDArray[PointDType]
342
+ Point3D: TypeAlias = npt.NDArray[PointDType]
282
343
  """``shape: (3,)``
283
344
 
284
- A 3-dimensional point: ``[float, float, float]``.
285
-
286
- .. note::
287
- This type alias is mostly made available for internal use, and
288
- only includes the NumPy type.
345
+ A NumPy array representing a 3-dimensional point: ``[float, float, float]``.
289
346
  """
290
347
 
291
- Point3D: TypeAlias = Union[InternalPoint3D, tuple[float, float, float]]
348
+ Point3DLike: TypeAlias = Union[Point3D, tuple[float, float, float]]
292
349
  """``shape: (3,)``
293
350
 
294
351
  A 3-dimensional point: ``[float, float, float]``.
352
+
353
+ This represents anything which can be converted to a :class:`Point3D` NumPy
354
+ array.
295
355
  """
296
356
 
297
- InternalPoint3D_Array: TypeAlias = npt.NDArray[PointDType]
298
- """``shape: (N, 3)``
357
+ Point3D_Array: TypeAlias = npt.NDArray[PointDType]
358
+ """``shape: (M, 3)``
359
+
360
+ A NumPy array representing a sequence of `Point3D` objects:
361
+ ``[[float, float, float], ...]``.
362
+ """
363
+
364
+ Point3DLike_Array: TypeAlias = Union[Point3D_Array, Sequence[Point3DLike]]
365
+ """``shape: (M, 3)``
299
366
 
300
367
  An array of `Point3D` objects: ``[[float, float, float], ...]``.
301
368
 
302
- .. note::
303
- This type alias is mostly made available for internal use, and
304
- only includes the NumPy type.
369
+ This represents anything which can be converted to a :class:`Point3D_Array`
370
+ NumPy array.
371
+
372
+ Please refer to the documentation of the function you are using for
373
+ further type information.
305
374
  """
306
375
 
307
- Point3D_Array: TypeAlias = Union[InternalPoint3D_Array, tuple[Point3D, ...]]
308
- """``shape: (N, 3)``
376
+ PointND: TypeAlias = npt.NDArray[PointDType]
377
+ """``shape: (N,)``
309
378
 
310
- An array of `Point3D` objects: ``[[float, float, float], ...]``.
379
+ A NumPy array representing an N-dimensional point: ``[float, ...]``.
380
+ """
381
+
382
+ PointNDLike: TypeAlias = Union[PointND, Sequence[float]]
383
+ """``shape: (N,)``
384
+
385
+ An N-dimensional point: ``[float, ...]``.
386
+
387
+ This represents anything which can be converted to a :class:`PointND` NumPy
388
+ array.
389
+ """
390
+
391
+ PointND_Array: TypeAlias = npt.NDArray[PointDType]
392
+ """``shape: (M, N)``
393
+
394
+ A NumPy array representing a sequence of `PointND` objects:
395
+ ``[[float, ...], ...]``.
396
+ """
397
+
398
+ PointNDLike_Array: TypeAlias = Union[PointND_Array, Sequence[PointNDLike]]
399
+ """``shape: (M, N)``
400
+
401
+ An array of `PointND` objects: ``[[float, ...], ...]``.
402
+
403
+ This represents anything which can be converted to a :class:`PointND_Array`
404
+ NumPy array.
311
405
 
312
406
  Please refer to the documentation of the function you are using for
313
407
  further type information.
@@ -411,23 +505,44 @@ A `MatrixMN` filled with zeros, typically created with
411
505
  Bézier types
412
506
  """
413
507
 
414
- QuadraticBezierPoints: TypeAlias = Union[
415
- npt.NDArray[PointDType], tuple[Point3D, Point3D, Point3D]
508
+ QuadraticBezierPoints: TypeAlias = Point3D_Array
509
+ """``shape: (3, 3)``
510
+
511
+ A `Point3D_Array` of three 3D control points for a single quadratic Bézier
512
+ curve:
513
+ ``[[float, float, float], [float, float, float], [float, float, float]]``.
514
+ """
515
+
516
+ QuadraticBezierPointsLike: TypeAlias = Union[
517
+ QuadraticBezierPoints, tuple[Point3DLike, Point3DLike, Point3DLike]
416
518
  ]
417
519
  """``shape: (3, 3)``
418
520
 
419
- A `Point3D_Array` of 3 control points for a single quadratic Bézier
521
+ A `Point3DLike_Array` of three 3D control points for a single quadratic Bézier
420
522
  curve:
421
523
  ``[[float, float, float], [float, float, float], [float, float, float]]``.
524
+
525
+ This represents anything which can be converted to a
526
+ :class:`QuadraticBezierPoints` NumPy array.
527
+ """
528
+
529
+ QuadraticBezierPoints_Array: TypeAlias = npt.NDArray[PointDType]
530
+ """``shape: (N, 3, 3)``
531
+
532
+ A NumPy array containing :math:`N` `QuadraticBezierPoints` objects:
533
+ ``[[[float, float, float], [float, float, float], [float, float, float]], ...]``.
422
534
  """
423
535
 
424
- QuadraticBezierPoints_Array: TypeAlias = Union[
425
- npt.NDArray[PointDType], tuple[QuadraticBezierPoints, ...]
536
+ QuadraticBezierPointsLike_Array: TypeAlias = Union[
537
+ QuadraticBezierPoints_Array, Sequence[QuadraticBezierPointsLike]
426
538
  ]
427
539
  """``shape: (N, 3, 3)``
428
540
 
429
- An array of :math:`N` `QuadraticBezierPoints` objects:
541
+ A sequence of :math:`N` `QuadraticBezierPointsLike` objects:
430
542
  ``[[[float, float, float], [float, float, float], [float, float, float]], ...]``.
543
+
544
+ This represents anything which can be converted to a
545
+ :class:`QuadraticBezierPoints_Array` NumPy array.
431
546
  """
432
547
 
433
548
  QuadraticBezierPath: TypeAlias = Point3D_Array
@@ -442,6 +557,21 @@ Please refer to the documentation of the function you are using for
442
557
  further type information.
443
558
  """
444
559
 
560
+ QuadraticBezierPathLike: TypeAlias = Point3DLike_Array
561
+ """``shape: (3*N, 3)``
562
+
563
+ A `Point3DLike_Array` of :math:`3N` points, where each one of the
564
+ :math:`N` consecutive blocks of 3 points represents a quadratic
565
+ Bézier curve:
566
+ ``[[float, float, float], ...], ...]``.
567
+
568
+ This represents anything which can be converted to a
569
+ :class:`QuadraticBezierPath` NumPy array.
570
+
571
+ Please refer to the documentation of the function you are using for
572
+ further type information.
573
+ """
574
+
445
575
  QuadraticSpline: TypeAlias = QuadraticBezierPath
446
576
  """``shape: (3*N, 3)``
447
577
 
@@ -453,23 +583,56 @@ Please refer to the documentation of the function you are using for
453
583
  further type information.
454
584
  """
455
585
 
456
- CubicBezierPoints: TypeAlias = Union[
457
- npt.NDArray[PointDType], tuple[Point3D, Point3D, Point3D, Point3D]
586
+ QuadraticSplineLike: TypeAlias = QuadraticBezierPathLike
587
+ """``shape: (3*N, 3)``
588
+
589
+ A special case of `QuadraticBezierPathLike` where all the :math:`N`
590
+ quadratic Bézier curves are connected, forming a quadratic spline:
591
+ ``[[float, float, float], ...], ...]``.
592
+
593
+ This represents anything which can be converted to a :class:`QuadraticSpline`
594
+ NumPy array.
595
+
596
+ Please refer to the documentation of the function you are using for
597
+ further type information.
598
+ """
599
+
600
+ CubicBezierPoints: TypeAlias = Point3D_Array
601
+ """``shape: (4, 3)``
602
+
603
+ A `Point3D_Array` of four 3D control points for a single cubic Bézier curve:
604
+ ``[[float, float, float], [float, float, float], [float, float, float], [float, float, float]]``.
605
+ """
606
+
607
+ CubicBezierPointsLike: TypeAlias = Union[
608
+ CubicBezierPoints, tuple[Point3DLike, Point3DLike, Point3DLike, Point3DLike]
458
609
  ]
459
610
  """``shape: (4, 3)``
460
611
 
461
- A `Point3D_Array` of 4 control points for a single cubic Bézier
462
- curve:
612
+ A `Point3DLike_Array` of 4 control points for a single cubic Bézier curve:
463
613
  ``[[float, float, float], [float, float, float], [float, float, float], [float, float, float]]``.
614
+
615
+ This represents anything which can be converted to a :class:`CubicBezierPoints`
616
+ NumPy array.
464
617
  """
465
618
 
466
- CubicBezierPoints_Array: TypeAlias = Union[
467
- npt.NDArray[PointDType], tuple[CubicBezierPoints, ...]
619
+ CubicBezierPoints_Array: TypeAlias = npt.NDArray[PointDType]
620
+ """``shape: (N, 4, 3)``
621
+
622
+ A NumPy array containing :math:`N` `CubicBezierPoints` objects:
623
+ ``[[[float, float, float], [float, float, float], [float, float, float], [float, float, float]], ...]``.
624
+ """
625
+
626
+ CubicBezierPointsLike_Array: TypeAlias = Union[
627
+ CubicBezierPoints_Array, Sequence[CubicBezierPointsLike]
468
628
  ]
469
629
  """``shape: (N, 4, 3)``
470
630
 
471
- An array of :math:`N` `CubicBezierPoints` objects:
631
+ A sequence of :math:`N` `CubicBezierPointsLike` objects:
472
632
  ``[[[float, float, float], [float, float, float], [float, float, float], [float, float, float]], ...]``.
633
+
634
+ This represents anything which can be converted to a
635
+ :class:`CubicBezierPoints_Array` NumPy array.
473
636
  """
474
637
 
475
638
  CubicBezierPath: TypeAlias = Point3D_Array
@@ -484,6 +647,21 @@ Please refer to the documentation of the function you are using for
484
647
  further type information.
485
648
  """
486
649
 
650
+ CubicBezierPathLike: TypeAlias = Point3DLike_Array
651
+ """``shape: (4*N, 3)``
652
+
653
+ A `Point3DLike_Array` of :math:`4N` points, where each one of the
654
+ :math:`N` consecutive blocks of 4 points represents a cubic Bézier
655
+ curve:
656
+ ``[[float, float, float], ...], ...]``.
657
+
658
+ This represents anything which can be converted to a
659
+ :class:`CubicBezierPath` NumPy array.
660
+
661
+ Please refer to the documentation of the function you are using for
662
+ further type information.
663
+ """
664
+
487
665
  CubicSpline: TypeAlias = CubicBezierPath
488
666
  """``shape: (4*N, 3)``
489
667
 
@@ -495,6 +673,20 @@ Please refer to the documentation of the function you are using for
495
673
  further type information.
496
674
  """
497
675
 
676
+ CubicSplineLike: TypeAlias = CubicBezierPathLike
677
+ """``shape: (4*N, 3)``
678
+
679
+ A special case of `CubicBezierPath` where all the :math:`N` cubic
680
+ Bézier curves are connected, forming a quadratic spline:
681
+ ``[[float, float, float], ...], ...]``.
682
+
683
+ This represents anything which can be converted to a
684
+ :class:`CubicSpline` NumPy array.
685
+
686
+ Please refer to the documentation of the function you are using for
687
+ further type information.
688
+ """
689
+
498
690
  BezierPoints: TypeAlias = Point3D_Array
499
691
  r"""``shape: (PPC, 3)``
500
692
 
@@ -507,10 +699,25 @@ Please refer to the documentation of the function you are using for
507
699
  further type information.
508
700
  """
509
701
 
510
- BezierPoints_Array: TypeAlias = Union[npt.NDArray[PointDType], tuple[BezierPoints, ...]]
702
+ BezierPointsLike: TypeAlias = Point3DLike_Array
703
+ r"""``shape: (PPC, 3)``
704
+
705
+ A `Point3DLike_Array` of :math:`\text{PPC}` control points
706
+ (:math:`\text{PPC: Points Per Curve} = n + 1`) for a single
707
+ :math:`n`-th degree Bézier curve:
708
+ ``[[float, float, float], ...]``.
709
+
710
+ This represents anything which can be converted to a
711
+ :class:`BezierPoints` NumPy array.
712
+
713
+ Please refer to the documentation of the function you are using for
714
+ further type information.
715
+ """
716
+
717
+ BezierPoints_Array: TypeAlias = npt.NDArray[PointDType]
511
718
  r"""``shape: (N, PPC, 3)``
512
719
 
513
- An array of :math:`N` `BezierPoints` objects containing
720
+ A NumPy array of :math:`N` `BezierPoints` objects containing
514
721
  :math:`\text{PPC}` `Point3D` objects each
515
722
  (:math:`\text{PPC: Points Per Curve} = n + 1`):
516
723
  ``[[[float, float, float], ...], ...]``.
@@ -519,6 +726,23 @@ Please refer to the documentation of the function you are using for
519
726
  further type information.
520
727
  """
521
728
 
729
+ BezierPointsLike_Array: TypeAlias = Union[
730
+ BezierPoints_Array, Sequence[BezierPointsLike]
731
+ ]
732
+ r"""``shape: (N, PPC, 3)``
733
+
734
+ A sequence of :math:`N` `BezierPointsLike` objects containing
735
+ :math:`\text{PPC}` `Point3DLike` objects each
736
+ (:math:`\text{PPC: Points Per Curve} = n + 1`):
737
+ ``[[[float, float, float], ...], ...]``.
738
+
739
+ This represents anything which can be converted to a
740
+ :class:`BezierPoints_Array` NumPy array.
741
+
742
+ Please refer to the documentation of the function you are using for
743
+ further type information.
744
+ """
745
+
522
746
  BezierPath: TypeAlias = Point3D_Array
523
747
  r"""``shape: (PPC*N, 3)``
524
748
 
@@ -532,6 +756,22 @@ Please refer to the documentation of the function you are using for
532
756
  further type information.
533
757
  """
534
758
 
759
+ BezierPathLike: TypeAlias = Point3DLike_Array
760
+ r"""``shape: (PPC*N, 3)``
761
+
762
+ A `Point3DLike_Array` of :math:`\text{PPC} \cdot N` points, where each
763
+ one of the :math:`N` consecutive blocks of :math:`\text{PPC}` control
764
+ points (:math:`\text{PPC: Points Per Curve} = n + 1`) represents a
765
+ Bézier curve of :math:`n`-th degree:
766
+ ``[[float, float, float], ...], ...]``.
767
+
768
+ This represents anything which can be converted to a
769
+ :class:`BezierPath` NumPy array.
770
+
771
+ Please refer to the documentation of the function you are using for
772
+ further type information.
773
+ """
774
+
535
775
  Spline: TypeAlias = BezierPath
536
776
  r"""``shape: (PPC*N, 3)``
537
777
 
@@ -545,6 +785,22 @@ Please refer to the documentation of the function you are using for
545
785
  further type information.
546
786
  """
547
787
 
788
+ SplineLike: TypeAlias = BezierPathLike
789
+ r"""``shape: (PPC*N, 3)``
790
+
791
+ A special case of `BezierPathLike` where all the :math:`N` Bézier curves
792
+ consisting of :math:`\text{PPC}` `Point3D` objects
793
+ (:math:`\text{PPC: Points Per Curve} = n + 1`) are connected, forming
794
+ an :math:`n`-th degree spline:
795
+ ``[[float, float, float], ...], ...]``.
796
+
797
+ This represents anything which can be converted to a
798
+ :class:`Spline` NumPy array.
799
+
800
+ Please refer to the documentation of the function you are using for
801
+ further type information.
802
+ """
803
+
548
804
  FlatBezierPoints: TypeAlias = Union[npt.NDArray[PointDType], tuple[float, ...]]
549
805
  """``shape: (3*PPC*N,)``
550
806
 
@@ -568,21 +824,25 @@ FunctionOverride: TypeAlias = Callable
568
824
  :class:`~.Mobject`.
569
825
  """
570
826
 
571
- PathFuncType: TypeAlias = Callable[[Point3D, Point3D, float], Point3D]
572
- """Function mapping two `Point3D` objects and an alpha value to a new
573
- `Point3D`.
827
+ PathFuncType: TypeAlias = Callable[[Point3DLike, Point3DLike, float], Point3DLike]
828
+ """Function mapping two :class:`Point3D` objects and an alpha value to a new
829
+ :class:`Point3D`.
574
830
  """
575
831
 
576
832
  MappingFunction: TypeAlias = Callable[[Point3D], Point3D]
577
- """A function mapping a `Point3D` to another `Point3D`."""
833
+ """A function mapping a :class:`Point3D` to another :class:`Point3D`."""
578
834
 
835
+ MultiMappingFunction: TypeAlias = Callable[[Point3D_Array], Point3D_Array]
836
+ """A function mapping a :class:`Point3D_Array` to another
837
+ :class:`Point3D_Array`.
838
+ """
579
839
 
580
840
  """
581
841
  [CATEGORY]
582
842
  Image types
583
843
  """
584
844
 
585
- Image: TypeAlias = npt.NDArray[ManimInt]
845
+ PixelArray: TypeAlias = npt.NDArray[ManimInt]
586
846
  """``shape: (height, width) | (height, width, 3) | (height, width, 4)``
587
847
 
588
848
  A rasterized image with a height of ``height`` pixels and a width of
@@ -595,24 +855,24 @@ lightness (for greyscale images), an `RGB_Array_Int` or an
595
855
  `RGBA_Array_Int`.
596
856
  """
597
857
 
598
- GrayscaleImage: TypeAlias = Image
858
+ GrayscalePixelArray: TypeAlias = PixelArray
599
859
  """``shape: (height, width)``
600
860
 
601
- A 100% opaque grayscale `Image`, where every pixel value is a
861
+ A 100% opaque grayscale `PixelArray`, where every pixel value is a
602
862
  `ManimInt` indicating its lightness (black -> gray -> white).
603
863
  """
604
864
 
605
- RGBImage: TypeAlias = Image
865
+ RGBPixelArray: TypeAlias = PixelArray
606
866
  """``shape: (height, width, 3)``
607
867
 
608
- A 100% opaque `Image` in color, where every pixel value is an
868
+ A 100% opaque `PixelArray` in color, where every pixel value is an
609
869
  `RGB_Array_Int` object.
610
870
  """
611
871
 
612
- RGBAImage: TypeAlias = Image
872
+ RGBAPixelArray: TypeAlias = PixelArray
613
873
  """``shape: (height, width, 4)``
614
874
 
615
- An `Image` in color where pixels can be transparent. Every pixel
875
+ A `PixelArray` in color where pixels can be transparent. Every pixel
616
876
  value is an `RGBA_Array_Int` object.
617
877
  """
618
878