manim 0.17.3__tar.gz → 0.18.0.post0__tar.gz

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 (219) hide show
  1. {manim-0.17.3 → manim-0.18.0.post0}/PKG-INFO +14 -14
  2. {manim-0.17.3 → manim-0.18.0.post0}/manim/__init__.py +1 -0
  3. {manim-0.17.3 → manim-0.18.0.post0}/manim/__main__.py +2 -0
  4. {manim-0.17.3 → manim-0.18.0.post0}/manim/_config/__init__.py +0 -1
  5. {manim-0.17.3 → manim-0.18.0.post0}/manim/_config/logger_utils.py +1 -0
  6. {manim-0.17.3 → manim-0.18.0.post0}/manim/_config/utils.py +14 -5
  7. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/changing.py +9 -5
  8. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/creation.py +8 -3
  9. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/indication.py +4 -4
  10. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/speedmodifier.py +2 -4
  11. manim-0.18.0.post0/manim/animation/updaters/mobject_update_utils.py +231 -0
  12. {manim-0.17.3 → manim-0.18.0.post0}/manim/camera/camera.py +31 -17
  13. manim-0.18.0.post0/manim/cli/checkhealth/checks.py +173 -0
  14. manim-0.18.0.post0/manim/cli/checkhealth/commands.py +81 -0
  15. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/render/global_options.py +6 -0
  16. {manim-0.17.3 → manim-0.18.0.post0}/manim/constants.py +58 -54
  17. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/geometry/__init__.py +1 -0
  18. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/geometry/arc.py +126 -91
  19. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/geometry/boolean_ops.py +6 -10
  20. manim-0.18.0.post0/manim/mobject/geometry/labeled.py +155 -0
  21. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/geometry/line.py +66 -50
  22. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/geometry/polygram.py +23 -15
  23. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/geometry/shape_matchers.py +24 -15
  24. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/geometry/tips.py +62 -40
  25. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/graph.py +3 -4
  26. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/graphing/coordinate_systems.py +190 -139
  27. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/graphing/number_line.py +5 -2
  28. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/graphing/probability.py +4 -3
  29. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/graphing/scale.py +7 -7
  30. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/logo.py +108 -22
  31. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/matrix.py +33 -37
  32. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/mobject.py +327 -260
  33. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/opengl_image_mobject.py +1 -1
  34. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/opengl_mobject.py +18 -12
  35. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/opengl_point_cloud_mobject.py +1 -1
  36. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/opengl_surface.py +1 -1
  37. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/opengl_vectorized_mobject.py +21 -17
  38. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/svg/brace.py +3 -1
  39. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/svg/svg_mobject.py +9 -11
  40. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/table.py +50 -54
  41. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/text/numbers.py +48 -6
  42. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/text/tex_mobject.py +8 -12
  43. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/text/text_mobject.py +32 -24
  44. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/three_d/three_d_utils.py +13 -8
  45. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/three_d/three_dimensions.py +61 -43
  46. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/types/image_mobject.py +5 -4
  47. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/types/point_cloud_mobject.py +8 -6
  48. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/types/vectorized_mobject.py +385 -258
  49. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/vector_field.py +19 -11
  50. {manim-0.17.3 → manim-0.18.0.post0}/manim/plugins/import_plugins.py +1 -1
  51. {manim-0.17.3 → manim-0.18.0.post0}/manim/plugins/plugins_flags.py +1 -6
  52. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shader.py +2 -2
  53. {manim-0.17.3 → manim-0.18.0.post0}/manim/scene/scene.py +15 -7
  54. {manim-0.17.3 → manim-0.18.0.post0}/manim/scene/scene_file_writer.py +1 -2
  55. {manim-0.17.3 → manim-0.18.0.post0}/manim/scene/three_d_scene.py +1 -1
  56. {manim-0.17.3 → manim-0.18.0.post0}/manim/scene/vector_space_scene.py +17 -7
  57. manim-0.18.0.post0/manim/typing.py +133 -0
  58. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/bezier.py +267 -83
  59. manim-0.18.0.post0/manim/utils/color/AS2700.py +234 -0
  60. manim-0.18.0.post0/manim/utils/color/BS381.py +315 -0
  61. manim-0.18.0.post0/manim/utils/color/X11.py +530 -0
  62. manim-0.18.0.post0/manim/utils/color/XKCD.py +949 -0
  63. manim-0.18.0.post0/manim/utils/color/__init__.py +58 -0
  64. manim-0.18.0.post0/manim/utils/color/core.py +1036 -0
  65. manim-0.18.0.post0/manim/utils/color/manim_colors.py +220 -0
  66. manim-0.18.0.post0/manim/utils/docbuild/autocolor_directive.py +92 -0
  67. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/docbuild/manim_directive.py +40 -6
  68. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/file_ops.py +1 -1
  69. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/hashing.py +1 -1
  70. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/iterables.py +1 -1
  71. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/rate_functions.py +33 -0
  72. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/simple_functions.py +0 -18
  73. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/space_ops.py +55 -42
  74. manim-0.18.0.post0/manim/utils/testing/__init__.py +0 -0
  75. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/testing/frames_comparison.py +9 -0
  76. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/tex.py +2 -0
  77. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/tex_file_writing.py +29 -2
  78. {manim-0.17.3 → manim-0.18.0.post0}/pyproject.toml +22 -13
  79. manim-0.17.3/manim/animation/updaters/mobject_update_utils.py +0 -113
  80. manim-0.17.3/manim/communitycolors.py +0 -9
  81. manim-0.17.3/manim/utils/color.py +0 -552
  82. {manim-0.17.3 → manim-0.18.0.post0}/LICENSE +0 -0
  83. {manim-0.17.3 → manim-0.18.0.post0}/LICENSE.community +0 -0
  84. {manim-0.17.3 → manim-0.18.0.post0}/README.md +0 -0
  85. {manim-0.17.3 → manim-0.18.0.post0}/manim/_config/cli_colors.py +0 -0
  86. {manim-0.17.3 → manim-0.18.0.post0}/manim/_config/default.cfg +0 -0
  87. {manim-0.17.3/manim/utils/testing → manim-0.18.0.post0/manim/animation}/__init__.py +0 -0
  88. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/animation.py +0 -0
  89. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/composition.py +0 -0
  90. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/fading.py +0 -0
  91. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/growing.py +0 -0
  92. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/movement.py +0 -0
  93. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/numbers.py +0 -0
  94. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/rotation.py +0 -0
  95. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/specialized.py +0 -0
  96. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/transform.py +0 -0
  97. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/transform_matching_parts.py +0 -0
  98. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/updaters/__init__.py +0 -0
  99. {manim-0.17.3 → manim-0.18.0.post0}/manim/animation/updaters/update.py +0 -0
  100. {manim-0.17.3/manim/utils/docbuild → manim-0.18.0.post0/manim/camera}/__init__.py +0 -0
  101. {manim-0.17.3 → manim-0.18.0.post0}/manim/camera/mapping_camera.py +0 -0
  102. {manim-0.17.3 → manim-0.18.0.post0}/manim/camera/moving_camera.py +0 -0
  103. {manim-0.17.3 → manim-0.18.0.post0}/manim/camera/multi_camera.py +0 -0
  104. {manim-0.17.3 → manim-0.18.0.post0}/manim/camera/three_d_camera.py +0 -0
  105. {manim-0.17.3/manim/utils → manim-0.18.0.post0/manim/cli}/__init__.py +0 -0
  106. {manim-0.17.3/manim/scene → manim-0.18.0.post0/manim/cli/cfg}/__init__.py +0 -0
  107. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/cfg/group.py +0 -0
  108. {manim-0.17.3/manim/renderer → manim-0.18.0.post0/manim/cli/checkhealth}/__init__.py +0 -0
  109. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/default_group.py +0 -0
  110. {manim-0.17.3/manim/mobject/opengl → manim-0.18.0.post0/manim/cli/init}/__init__.py +0 -0
  111. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/init/commands.py +0 -0
  112. {manim-0.17.3/manim/mobject → manim-0.18.0.post0/manim/cli/new}/__init__.py +0 -0
  113. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/new/group.py +0 -0
  114. {manim-0.17.3/manim/gui → manim-0.18.0.post0/manim/cli/plugins}/__init__.py +0 -0
  115. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/plugins/commands.py +0 -0
  116. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/render/__init__.py +0 -0
  117. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/render/commands.py +0 -0
  118. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/render/ease_of_access_options.py +0 -0
  119. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/render/output_options.py +0 -0
  120. {manim-0.17.3 → manim-0.18.0.post0}/manim/cli/render/render_options.py +0 -0
  121. {manim-0.17.3/manim/cli/plugins → manim-0.18.0.post0/manim/gui}/__init__.py +0 -0
  122. {manim-0.17.3 → manim-0.18.0.post0}/manim/gui/gui.py +0 -0
  123. {manim-0.17.3/manim/cli/new → manim-0.18.0.post0/manim/mobject}/__init__.py +0 -0
  124. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/frame.py +0 -0
  125. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/graphing/__init__.py +0 -0
  126. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/graphing/functions.py +0 -0
  127. {manim-0.17.3/manim/cli/init → manim-0.18.0.post0/manim/mobject/opengl}/__init__.py +0 -0
  128. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/dot_cloud.py +0 -0
  129. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/opengl_compatibility.py +0 -0
  130. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/opengl_geometry.py +0 -0
  131. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/opengl/opengl_three_dimensions.py +0 -0
  132. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/svg/__init__.py +0 -0
  133. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/text/__init__.py +0 -0
  134. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/text/code_mobject.py +0 -0
  135. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/three_d/__init__.py +0 -0
  136. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/three_d/polyhedra.py +0 -0
  137. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/types/__init__.py +0 -0
  138. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/utils.py +0 -0
  139. {manim-0.17.3 → manim-0.18.0.post0}/manim/mobject/value_tracker.py +0 -0
  140. {manim-0.17.3 → manim-0.18.0.post0}/manim/opengl/__init__.py +0 -0
  141. {manim-0.17.3 → manim-0.18.0.post0}/manim/plugins/__init__.py +0 -0
  142. {manim-0.17.3/manim/cli/cfg → manim-0.18.0.post0/manim/renderer}/__init__.py +0 -0
  143. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/cairo_renderer.py +0 -0
  144. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/opengl_renderer.py +0 -0
  145. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/opengl_renderer_window.py +0 -0
  146. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shader_wrapper.py +0 -0
  147. {manim-0.17.3/manim/renderer/shaders/manim_coords → manim-0.18.0.post0/manim/renderer/shaders/default}/frag.glsl +0 -0
  148. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/default/vert.glsl +0 -0
  149. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/design.frag +0 -0
  150. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/design_2.frag +0 -0
  151. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/design_3.frag +0 -0
  152. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/image/frag.glsl +0 -0
  153. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/image/vert.glsl +0 -0
  154. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/NOTE.md +0 -0
  155. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/add_light.glsl +0 -0
  156. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/camera_uniform_declarations.glsl +0 -0
  157. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/finalize_color.glsl +0 -0
  158. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/get_gl_Position.glsl +0 -0
  159. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/get_rotated_surface_unit_normal_vector.glsl +0 -0
  160. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/get_unit_normal.glsl +0 -0
  161. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/position_point_into_frame.glsl +0 -0
  162. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/quadratic_bezier_distance.glsl +0 -0
  163. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/include/quadratic_bezier_geometry_functions.glsl +0 -0
  164. {manim-0.17.3/manim/renderer/shaders/default → manim-0.18.0.post0/manim/renderer/shaders/manim_coords}/frag.glsl +0 -0
  165. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/manim_coords/vert.glsl +0 -0
  166. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/quadratic_bezier_fill/frag.glsl +0 -0
  167. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/quadratic_bezier_fill/geom.glsl +0 -0
  168. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/quadratic_bezier_fill/vert.glsl +0 -0
  169. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/quadratic_bezier_stroke/frag.glsl +0 -0
  170. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/quadratic_bezier_stroke/geom.glsl +0 -0
  171. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/quadratic_bezier_stroke/vert.glsl +0 -0
  172. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/simple_vert.glsl +0 -0
  173. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/surface/frag.glsl +0 -0
  174. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/surface/vert.glsl +0 -0
  175. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/test/frag.glsl +0 -0
  176. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/test/vert.glsl +0 -0
  177. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/textured_surface/frag.glsl +0 -0
  178. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/textured_surface/vert.glsl +0 -0
  179. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/true_dot/frag.glsl +0 -0
  180. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/true_dot/geom.glsl +0 -0
  181. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/true_dot/vert.glsl +0 -0
  182. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/vectorized_mobject_fill/frag.glsl +0 -0
  183. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/vectorized_mobject_fill/vert.glsl +0 -0
  184. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/vectorized_mobject_stroke/frag.glsl +0 -0
  185. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/vectorized_mobject_stroke/vert.glsl +0 -0
  186. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/vertex_colors/frag.glsl +0 -0
  187. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/shaders/vertex_colors/vert.glsl +0 -0
  188. {manim-0.17.3 → manim-0.18.0.post0}/manim/renderer/vectorized_mobject_rendering.py +0 -0
  189. {manim-0.17.3/manim/cli → manim-0.18.0.post0/manim/scene}/__init__.py +0 -0
  190. {manim-0.17.3 → manim-0.18.0.post0}/manim/scene/moving_camera_scene.py +0 -0
  191. {manim-0.17.3 → manim-0.18.0.post0}/manim/scene/section.py +0 -0
  192. {manim-0.17.3 → manim-0.18.0.post0}/manim/scene/zoomed_scene.py +0 -0
  193. {manim-0.17.3 → manim-0.18.0.post0}/manim/templates/Axes.mtp +0 -0
  194. {manim-0.17.3 → manim-0.18.0.post0}/manim/templates/Default.mtp +0 -0
  195. {manim-0.17.3 → manim-0.18.0.post0}/manim/templates/MovingCamera.mtp +0 -0
  196. {manim-0.17.3 → manim-0.18.0.post0}/manim/templates/template.cfg +0 -0
  197. {manim-0.17.3/manim/camera → manim-0.18.0.post0/manim/utils}/__init__.py +0 -0
  198. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/caching.py +0 -0
  199. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/commands.py +0 -0
  200. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/config_ops.py +0 -0
  201. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/debug.py +0 -0
  202. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/deprecation.py +0 -0
  203. {manim-0.17.3/manim/animation → manim-0.18.0.post0/manim/utils/docbuild}/__init__.py +0 -0
  204. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/exceptions.py +0 -0
  205. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/family.py +0 -0
  206. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/family_ops.py +0 -0
  207. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/images.py +0 -0
  208. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/ipython_magic.py +0 -0
  209. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/module_ops.py +0 -0
  210. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/opengl.py +0 -0
  211. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/paths.py +0 -0
  212. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/sounds.py +0 -0
  213. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/testing/_frames_testers.py +0 -0
  214. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/testing/_show_diff.py +0 -0
  215. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/testing/_test_class_makers.py +0 -0
  216. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/testing/config_graphical_tests_monoframe.cfg +0 -0
  217. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/testing/config_graphical_tests_multiframes.cfg +0 -0
  218. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/tex_templates.py +0 -0
  219. {manim-0.17.3 → manim-0.18.0.post0}/manim/utils/unit.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: manim
3
- Version: 0.17.3
3
+ Version: 0.18.0.post0
4
4
  Summary: Animation engine for explanatory math videos.
5
5
  Home-page: https://www.manim.community/
6
6
  License: MIT
7
7
  Author: The Manim Community Developers
8
8
  Author-email: contact@manim.community
9
- Requires-Python: >=3.8,<3.12
9
+ Requires-Python: >=3.8,<3.13
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Natural Language :: English
@@ -15,10 +15,7 @@ Classifier: Programming Language :: Python :: 3.8
15
15
  Classifier: Programming Language :: Python :: 3.9
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.8
21
- Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.12
22
19
  Classifier: Topic :: Multimedia :: Graphics
23
20
  Classifier: Topic :: Multimedia :: Video
24
21
  Classifier: Topic :: Scientific/Engineering
@@ -29,31 +26,34 @@ Requires-Dist: Pygments (>=2.10.0,<3.0.0)
29
26
  Requires-Dist: backports.cached-property (>=1.0.1,<2.0.0) ; python_version < "3.8"
30
27
  Requires-Dist: click (>=7.2,<=9.0)
31
28
  Requires-Dist: click-default-group (>=1.2.2,<2.0.0)
32
- Requires-Dist: cloup (>=0.13.0,<0.14.0)
33
- Requires-Dist: colour (>=0.1.5,<0.2.0)
29
+ Requires-Dist: cloup (>=0.13,<2.2)
34
30
  Requires-Dist: dearpygui (>=1.3.1,<2.0.0) ; extra == "gui"
35
31
  Requires-Dist: decorator (>=5.0.7,<6.0.0)
36
32
  Requires-Dist: importlib-metadata (>=4.10.0,<5.0.0) ; python_version < "3.8"
37
33
  Requires-Dist: isosurfaces (==0.1.0)
38
34
  Requires-Dist: jupyterlab (>=3.0,<4.0) ; extra == "jupyterlab"
39
- Requires-Dist: manimpango (>=0.4.0.post0,<0.5.0)
35
+ Requires-Dist: manimpango (>=0.5.0,<1.0.0)
40
36
  Requires-Dist: mapbox-earcut (>=1.0.0,<2.0.0)
41
37
  Requires-Dist: moderngl (>=5.6.3,<6.0.0)
42
38
  Requires-Dist: moderngl-window (>=2.3.0,<3.0.0)
43
- Requires-Dist: networkx (>=2.5,<3.0)
39
+ Requires-Dist: networkx (>=2.5,<3.3)
44
40
  Requires-Dist: notebook (>=6.4,<7.0) ; extra == "jupyterlab"
45
- Requires-Dist: numpy (>=1.19,<2.0)
41
+ Requires-Dist: numpy (>=1.22,<2.0) ; python_version < "3.12"
42
+ Requires-Dist: numpy (>=1.26,<2.0) ; python_version >= "3.12"
46
43
  Requires-Dist: pycairo (>=1.21,<2.0)
47
44
  Requires-Dist: pydub (>=0.25.1,<0.26.0)
48
45
  Requires-Dist: requests (>=2.26.0,<3.0.0)
49
46
  Requires-Dist: rich (>=6.0,!=12.0.0)
50
- Requires-Dist: scipy (>=1.7.3,<2.0.0)
47
+ Requires-Dist: scipy (>=1.11,<2.0) ; python_version >= "3.12"
48
+ Requires-Dist: scipy (>=1.7.3,<2.0.0) ; python_version < "3.12"
51
49
  Requires-Dist: screeninfo (>=0.8,<0.9)
52
- Requires-Dist: skia-pathops (>=0.7.0,<0.8.0)
50
+ Requires-Dist: skia-pathops (>=0.7.0,<0.8.0) ; python_version < "3.12"
51
+ Requires-Dist: skia-pathops (>=0.8.0.post1,<0.9.0) ; python_version >= "3.12"
53
52
  Requires-Dist: srt (>=3.5.0,<4.0.0)
54
53
  Requires-Dist: svgelements (>=1.8.0,<2.0.0)
55
54
  Requires-Dist: tqdm (>=4.62.3,<5.0.0)
56
- Requires-Dist: watchdog (>=2.1.6,<3.0.0)
55
+ Requires-Dist: typing-extensions (>=4.7.1,<5.0.0)
56
+ Requires-Dist: watchdog (>=2.1,<=3.0.0)
57
57
  Project-URL: Bug Tracker, https://github.com/ManimCommunity/manim/issues
58
58
  Project-URL: Changelog, https://docs.manim.community/en/stable/changelog.html
59
59
  Project-URL: Documentation, https://docs.manim.community/
@@ -46,6 +46,7 @@ from .constants import *
46
46
  from .mobject.frame import *
47
47
  from .mobject.geometry.arc import *
48
48
  from .mobject.geometry.boolean_ops import *
49
+ from .mobject.geometry.labeled import *
49
50
  from .mobject.geometry.line import *
50
51
  from .mobject.geometry.polygram import *
51
52
  from .mobject.geometry.shape_matchers import *
@@ -7,6 +7,7 @@ import cloup
7
7
 
8
8
  from . import __version__, cli_ctx_settings, console
9
9
  from .cli.cfg.group import cfg
10
+ from .cli.checkhealth.commands import checkhealth
10
11
  from .cli.default_group import DefaultGroup
11
12
  from .cli.init.commands import init
12
13
  from .cli.new.group import new
@@ -48,6 +49,7 @@ def main(ctx):
48
49
  pass
49
50
 
50
51
 
52
+ main.add_command(checkhealth)
51
53
  main.add_command(cfg)
52
54
  main.add_command(plugins)
53
55
  main.add_command(init)
@@ -20,7 +20,6 @@ __all__ = [
20
20
  ]
21
21
 
22
22
  parser = make_config_parser()
23
- logger: logging.Logger
24
23
 
25
24
  # The logger can be accessed from anywhere as manim.logger, or as
26
25
  # logging.getLogger("manim"). The console must be accessed as manim.console.
@@ -26,6 +26,7 @@ from rich.theme import Theme
26
26
 
27
27
  if TYPE_CHECKING:
28
28
  from pathlib import Path
29
+
29
30
  HIGHLIGHTED_KEYWORDS = [ # these keywords are highlighted specially
30
31
  "Played",
31
32
  "animations",
@@ -23,13 +23,13 @@ from collections.abc import Mapping, MutableMapping
23
23
  from pathlib import Path
24
24
  from typing import Any, Iterable, Iterator
25
25
 
26
- import colour
27
26
  import numpy as np
28
27
 
29
28
  from .. import constants
30
29
  from ..constants import RendererType
30
+ from ..typing import StrPath
31
+ from ..utils.color import ManimColor
31
32
  from ..utils.tex import TexTemplate, TexTemplateFromFile
32
- from ..utils.tex_templates import TexTemplateLibrary
33
33
 
34
34
 
35
35
  def config_file_paths() -> list[Path]:
@@ -76,7 +76,7 @@ def config_file_paths() -> list[Path]:
76
76
 
77
77
 
78
78
  def make_config_parser(
79
- custom_file: str | os.PathLike | None = None,
79
+ custom_file: StrPath | None = None,
80
80
  ) -> configparser.ConfigParser:
81
81
  """Make a :class:`ConfigParser` object and load any ``.cfg`` files.
82
82
 
@@ -309,6 +309,7 @@ class ManimConfig(MutableMapping):
309
309
  "write_to_movie",
310
310
  "zero_pad",
311
311
  "force_window",
312
+ "no_latex_cleanup",
312
313
  }
313
314
 
314
315
  def __init__(self) -> None:
@@ -580,6 +581,7 @@ class ManimConfig(MutableMapping):
580
581
  "use_projection_stroke_shaders",
581
582
  "enable_wireframe",
582
583
  "force_window",
584
+ "no_latex_cleanup",
583
585
  ]:
584
586
  setattr(self, key, parser["CLI"].getboolean(key, fallback=False))
585
587
 
@@ -756,6 +758,7 @@ class ManimConfig(MutableMapping):
756
758
  "enable_wireframe",
757
759
  "force_window",
758
760
  "dry_run",
761
+ "no_latex_cleanup",
759
762
  ]:
760
763
  if hasattr(args, key):
761
764
  attr = getattr(args, key)
@@ -960,6 +963,12 @@ class ManimConfig(MutableMapping):
960
963
  doc="Set to force window when using the opengl renderer",
961
964
  )
962
965
 
966
+ no_latex_cleanup = property(
967
+ lambda self: self._d["no_latex_cleanup"],
968
+ lambda self, val: self._set_boolean("no_latex_cleanup", val),
969
+ doc="Prevents deletion of .aux, .dvi, and .log files produced by Tex and MathTex.",
970
+ )
971
+
963
972
  @property
964
973
  def verbosity(self):
965
974
  """Logger verbosity; "DEBUG", "INFO", "WARNING", "ERROR", or "CRITICAL" (-v)."""
@@ -1096,7 +1105,7 @@ class ManimConfig(MutableMapping):
1096
1105
 
1097
1106
  background_color = property(
1098
1107
  lambda self: self._d["background_color"],
1099
- lambda self, val: self._d.__setitem__("background_color", colour.Color(val)),
1108
+ lambda self, val: self._d.__setitem__("background_color", ManimColor(val)),
1100
1109
  doc="Background color of the scene (-c).",
1101
1110
  )
1102
1111
 
@@ -1172,7 +1181,7 @@ class ManimConfig(MutableMapping):
1172
1181
  keys = ["pixel_width", "pixel_height", "frame_rate"]
1173
1182
  q = {k: self[k] for k in keys}
1174
1183
  for qual in constants.QUALITIES:
1175
- if all([q[k] == constants.QUALITIES[qual][k] for k in keys]):
1184
+ if all(q[k] == constants.QUALITIES[qual][k] for k in keys):
1176
1185
  return qual
1177
1186
  return None
1178
1187
 
@@ -6,12 +6,16 @@ __all__ = ["AnimatedBoundary", "TracedPath"]
6
6
 
7
7
  from typing import Callable
8
8
 
9
- from colour import Color
10
-
11
- from manim._config import config
12
9
  from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL
13
10
  from manim.mobject.types.vectorized_mobject import VGroup, VMobject
14
- from manim.utils.color import BLUE_B, BLUE_D, BLUE_E, GREY_BROWN, WHITE
11
+ from manim.utils.color import (
12
+ BLUE_B,
13
+ BLUE_D,
14
+ BLUE_E,
15
+ GREY_BROWN,
16
+ WHITE,
17
+ ParsableManimColor,
18
+ )
15
19
  from manim.utils.rate_functions import smooth
16
20
 
17
21
 
@@ -140,7 +144,7 @@ class TracedPath(VMobject, metaclass=ConvertToOpenGL):
140
144
  self,
141
145
  traced_point_func: Callable,
142
146
  stroke_width: float = 2,
143
- stroke_color: Color = WHITE,
147
+ stroke_color: ParsableManimColor | None = WHITE,
144
148
  dissipating_time: float | None = None,
145
149
  **kwargs,
146
150
  ):
@@ -77,13 +77,13 @@ import itertools as it
77
77
  from typing import TYPE_CHECKING, Callable, Iterable, Sequence
78
78
 
79
79
  import numpy as np
80
- from colour import Color
81
80
 
82
81
  if TYPE_CHECKING:
83
82
  from manim.mobject.text.text_mobject import Text
84
83
 
85
84
  from manim.mobject.opengl.opengl_surface import OpenGLSurface
86
85
  from manim.mobject.opengl.opengl_vectorized_mobject import OpenGLVMobject
86
+ from manim.utils.color import ManimColor
87
87
 
88
88
  from .. import config
89
89
  from ..animation.animation import Animation
@@ -92,7 +92,7 @@ from ..constants import TAU
92
92
  from ..mobject.mobject import Group, Mobject
93
93
  from ..mobject.types.vectorized_mobject import VMobject
94
94
  from ..utils.bezier import integer_interpolate
95
- from ..utils.rate_functions import double_smooth, linear, smooth
95
+ from ..utils.rate_functions import double_smooth, linear
96
96
 
97
97
 
98
98
  class ShowPartial(Animation):
@@ -259,7 +259,7 @@ class DrawBorderThenFill(Animation):
259
259
  sm.set_stroke(color=self.get_stroke_color(sm), width=self.stroke_width)
260
260
  return outline
261
261
 
262
- def get_stroke_color(self, vmobject: VMobject | OpenGLVMobject) -> Color:
262
+ def get_stroke_color(self, vmobject: VMobject | OpenGLVMobject) -> ManimColor:
263
263
  if self.stroke_color:
264
264
  return self.stroke_color
265
265
  elif vmobject.get_stroke_width() > 0:
@@ -563,6 +563,11 @@ class AddTextLetterByLetter(ShowIncreasingSubsets):
563
563
  **kwargs,
564
564
  ) -> None:
565
565
  self.time_per_char = time_per_char
566
+ # Check for empty text using family_members_with_points()
567
+ if not text.family_members_with_points():
568
+ raise ValueError(
569
+ f"The text mobject {text} does not seem to contain any characters."
570
+ )
566
571
  if run_time is None:
567
572
  # minimum time per character is 1/frame_rate, otherwise
568
573
  # the animation does not finish.
@@ -40,12 +40,12 @@ __all__ = [
40
40
  from typing import Callable, Iterable, Optional, Tuple, Type, Union
41
41
 
42
42
  import numpy as np
43
- from colour import Color
44
43
 
45
44
  from manim.mobject.geometry.arc import Circle, Dot
46
45
  from manim.mobject.geometry.line import Line
47
46
  from manim.mobject.geometry.polygram import Rectangle
48
47
  from manim.mobject.geometry.shape_matchers import SurroundingRectangle
48
+ from manim.scene.scene import Scene
49
49
 
50
50
  from .. import config
51
51
  from ..animation.animation import Animation
@@ -58,7 +58,7 @@ from ..constants import *
58
58
  from ..mobject.mobject import Mobject
59
59
  from ..mobject.types.vectorized_mobject import VGroup, VMobject
60
60
  from ..utils.bezier import interpolate, inverse_interpolate
61
- from ..utils.color import GREY, YELLOW
61
+ from ..utils.color import GREY, YELLOW, ParsableManimColor
62
62
  from ..utils.deprecation import deprecated
63
63
  from ..utils.rate_functions import smooth, there_and_back, wiggle
64
64
  from ..utils.space_ops import normalize
@@ -314,7 +314,7 @@ class ShowPassingFlash(ShowPartial):
314
314
  lower = max(lower, 0)
315
315
  return (lower, upper)
316
316
 
317
- def clean_up_from_scene(self, scene: "Scene") -> None:
317
+ def clean_up_from_scene(self, scene: Scene) -> None:
318
318
  super().clean_up_from_scene(scene)
319
319
  for submob, start in self.get_all_families_zipped():
320
320
  submob.pointwise_become_partial(start, 0, 1)
@@ -609,7 +609,7 @@ class Circumscribe(Succession):
609
609
  fade_out=False,
610
610
  time_width=0.3,
611
611
  buff: float = SMALL_BUFF,
612
- color: Color = YELLOW,
612
+ color: ParsableManimColor = YELLOW,
613
613
  run_time=1,
614
614
  stroke_width=DEFAULT_STROKE_WIDTH,
615
615
  **kwargs
@@ -2,13 +2,12 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import inspect
5
6
  import types
6
7
  from typing import Callable
7
8
 
8
9
  from numpy import piecewise
9
10
 
10
- from manim.utils.simple_functions import get_parameters
11
-
12
11
  from ..animation.animation import Animation, Wait, prepare_animation
13
12
  from ..animation.composition import AnimationGroup
14
13
  from ..mobject.mobject import Mobject, Updater, _AnimationBuilder
@@ -260,8 +259,7 @@ class ChangeSpeed(Animation):
260
259
  :class:`.ChangeSpeed`
261
260
  :meth:`.Mobject.add_updater`
262
261
  """
263
- parameters = get_parameters(update_function)
264
- if "dt" in parameters:
262
+ if "dt" in inspect.signature(update_function).parameters:
265
263
  mobject.add_updater(
266
264
  lambda mob, dt: update_function(
267
265
  mob, ChangeSpeed.dt if ChangeSpeed.is_changing_dt else dt
@@ -0,0 +1,231 @@
1
+ """Utility functions for continuous animation of mobjects."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "assert_is_mobject_method",
7
+ "always",
8
+ "f_always",
9
+ "always_redraw",
10
+ "always_shift",
11
+ "always_rotate",
12
+ "turn_animation_into_updater",
13
+ "cycle_animation",
14
+ ]
15
+
16
+
17
+ import inspect
18
+ from typing import TYPE_CHECKING, Callable
19
+
20
+ import numpy as np
21
+
22
+ from manim.constants import DEGREES, RIGHT
23
+ from manim.mobject.mobject import Mobject
24
+ from manim.opengl import OpenGLMobject
25
+ from manim.utils.space_ops import normalize
26
+
27
+ if TYPE_CHECKING:
28
+ from manim.animation.animation import Animation
29
+
30
+
31
+ def assert_is_mobject_method(method: Callable) -> None:
32
+ assert inspect.ismethod(method)
33
+ mobject = method.__self__
34
+ assert isinstance(mobject, (Mobject, OpenGLMobject))
35
+
36
+
37
+ def always(method: Callable, *args, **kwargs) -> Mobject:
38
+ assert_is_mobject_method(method)
39
+ mobject = method.__self__
40
+ func = method.__func__
41
+ mobject.add_updater(lambda m: func(m, *args, **kwargs))
42
+ return mobject
43
+
44
+
45
+ def f_always(method: Callable[[Mobject], None], *arg_generators, **kwargs) -> Mobject:
46
+ """
47
+ More functional version of always, where instead
48
+ of taking in args, it takes in functions which output
49
+ the relevant arguments.
50
+ """
51
+ assert_is_mobject_method(method)
52
+ mobject = method.__self__
53
+ func = method.__func__
54
+
55
+ def updater(mob):
56
+ args = [arg_generator() for arg_generator in arg_generators]
57
+ func(mob, *args, **kwargs)
58
+
59
+ mobject.add_updater(updater)
60
+ return mobject
61
+
62
+
63
+ def always_redraw(func: Callable[[], Mobject]) -> Mobject:
64
+ """Redraw the mobject constructed by a function every frame.
65
+
66
+ This function returns a mobject with an attached updater that
67
+ continuously regenerates the mobject according to the
68
+ specified function.
69
+
70
+ Parameters
71
+ ----------
72
+ func
73
+ A function without (required) input arguments that returns
74
+ a mobject.
75
+
76
+ Examples
77
+ --------
78
+
79
+ .. manim:: TangentAnimation
80
+
81
+ class TangentAnimation(Scene):
82
+ def construct(self):
83
+ ax = Axes()
84
+ sine = ax.plot(np.sin, color=RED)
85
+ alpha = ValueTracker(0)
86
+ point = always_redraw(
87
+ lambda: Dot(
88
+ sine.point_from_proportion(alpha.get_value()),
89
+ color=BLUE
90
+ )
91
+ )
92
+ tangent = always_redraw(
93
+ lambda: TangentLine(
94
+ sine,
95
+ alpha=alpha.get_value(),
96
+ color=YELLOW,
97
+ length=4
98
+ )
99
+ )
100
+ self.add(ax, sine, point, tangent)
101
+ self.play(alpha.animate.set_value(1), rate_func=linear, run_time=2)
102
+ """
103
+ mob = func()
104
+ mob.add_updater(lambda _: mob.become(func()))
105
+ return mob
106
+
107
+
108
+ def always_shift(
109
+ mobject: Mobject, direction: np.ndarray[np.float64] = RIGHT, rate: float = 0.1
110
+ ) -> Mobject:
111
+ """A mobject which is continuously shifted along some direction
112
+ at a certain rate.
113
+
114
+ Parameters
115
+ ----------
116
+ mobject
117
+ The mobject to shift.
118
+ direction
119
+ The direction to shift. The vector is normalized, the specified magnitude
120
+ is not relevant.
121
+ rate
122
+ Length in Manim units which the mobject travels in one
123
+ second along the specified direction.
124
+
125
+ Examples
126
+ --------
127
+
128
+ .. manim:: ShiftingSquare
129
+
130
+ class ShiftingSquare(Scene):
131
+ def construct(self):
132
+ sq = Square().set_fill(opacity=1)
133
+ tri = Triangle()
134
+ VGroup(sq, tri).arrange(LEFT)
135
+
136
+ # construct a square which is continuously
137
+ # shifted to the right
138
+ always_shift(sq, RIGHT, rate=5)
139
+
140
+ self.add(sq)
141
+ self.play(tri.animate.set_fill(opacity=1))
142
+ """
143
+ mobject.add_updater(lambda m, dt: m.shift(dt * rate * normalize(direction)))
144
+ return mobject
145
+
146
+
147
+ def always_rotate(mobject: Mobject, rate: float = 20 * DEGREES, **kwargs) -> Mobject:
148
+ """A mobject which is continuously rotated at a certain rate.
149
+
150
+ Parameters
151
+ ----------
152
+ mobject
153
+ The mobject to be rotated.
154
+ rate
155
+ The angle which the mobject is rotated by
156
+ over one second.
157
+ kwags
158
+ Further arguments to be passed to :meth:`.Mobject.rotate`.
159
+
160
+ Examples
161
+ --------
162
+
163
+ .. manim:: SpinningTriangle
164
+
165
+ class SpinningTriangle(Scene):
166
+ def construct(self):
167
+ tri = Triangle().set_fill(opacity=1).set_z_index(2)
168
+ sq = Square().to_edge(LEFT)
169
+
170
+ # will keep spinning while there is an animation going on
171
+ always_rotate(tri, rate=2*PI, about_point=ORIGIN)
172
+
173
+ self.add(tri, sq)
174
+ self.play(sq.animate.to_edge(RIGHT), rate_func=linear, run_time=1)
175
+ """
176
+ mobject.add_updater(lambda m, dt: m.rotate(dt * rate, **kwargs))
177
+ return mobject
178
+
179
+
180
+ def turn_animation_into_updater(
181
+ animation: Animation, cycle: bool = False, **kwargs
182
+ ) -> Mobject:
183
+ """
184
+ Add an updater to the animation's mobject which applies
185
+ the interpolation and update functions of the animation
186
+
187
+ If cycle is True, this repeats over and over. Otherwise,
188
+ the updater will be popped upon completion
189
+
190
+ Examples
191
+ --------
192
+
193
+ .. manim:: WelcomeToManim
194
+
195
+ class WelcomeToManim(Scene):
196
+ def construct(self):
197
+ words = Text("Welcome to")
198
+ banner = ManimBanner().scale(0.5)
199
+ VGroup(words, banner).arrange(DOWN)
200
+
201
+ turn_animation_into_updater(Write(words, run_time=0.9))
202
+ self.add(words)
203
+ self.wait(0.5)
204
+ self.play(banner.expand(), run_time=0.5)
205
+ """
206
+ mobject = animation.mobject
207
+ animation.suspend_mobject_updating = False
208
+ animation.begin()
209
+ animation.total_time = 0
210
+
211
+ def update(m: Mobject, dt: float):
212
+ run_time = animation.get_run_time()
213
+ time_ratio = animation.total_time / run_time
214
+ if cycle:
215
+ alpha = time_ratio % 1
216
+ else:
217
+ alpha = np.clip(time_ratio, 0, 1)
218
+ if alpha >= 1:
219
+ animation.finish()
220
+ m.remove_updater(update)
221
+ return
222
+ animation.interpolate(alpha)
223
+ animation.update_mobjects(dt)
224
+ animation.total_time += dt
225
+
226
+ mobject.add_updater(update)
227
+ return mobject
228
+
229
+
230
+ def cycle_animation(animation: Animation, **kwargs) -> Mobject:
231
+ return turn_animation_into_updater(animation, cycle=True, **kwargs)
@@ -9,7 +9,6 @@ import copy
9
9
  import itertools as it
10
10
  import operator as op
11
11
  import pathlib
12
- import time
13
12
  from functools import reduce
14
13
  from typing import Any, Callable, Iterable
15
14
 
@@ -24,7 +23,7 @@ from ..mobject.mobject import Mobject
24
23
  from ..mobject.types.image_mobject import AbstractImageMobject
25
24
  from ..mobject.types.point_cloud_mobject import PMobject
26
25
  from ..mobject.types.vectorized_mobject import VMobject
27
- from ..utils.color import color_to_int_rgba
26
+ from ..utils.color import ManimColor, ParsableManimColor, color_to_int_rgba
28
27
  from ..utils.family import extract_mobject_family_members
29
28
  from ..utils.images import get_full_raster_image_path
30
29
  from ..utils.iterables import list_difference_update
@@ -75,6 +74,8 @@ class Camera:
75
74
  frame_height: float | None = None,
76
75
  frame_width: float | None = None,
77
76
  frame_rate: float | None = None,
77
+ background_color: ParsableManimColor | None = None,
78
+ background_opacity: float | None = None,
78
79
  **kwargs,
79
80
  ):
80
81
  self.background_image = background_image
@@ -106,9 +107,14 @@ class Camera:
106
107
  frame_rate = config["frame_rate"]
107
108
  self.frame_rate = frame_rate
108
109
 
109
- # TODO: change this to not use kwargs.get
110
- for attr in ["background_color", "background_opacity"]:
111
- setattr(self, f"_{attr}", kwargs.get(attr, config[attr]))
110
+ if background_color is None:
111
+ self._background_color = ManimColor.parse(config["background_color"])
112
+ else:
113
+ self._background_color = ManimColor.parse(background_color)
114
+ if background_opacity is None:
115
+ self._background_opacity = config["background_opacity"]
116
+ else:
117
+ self._background_opacity = background_opacity
112
118
 
113
119
  # This one is in the same boat as the above, but it doesn't have the
114
120
  # same name as the corresponding key so it has to be handled on its own
@@ -886,8 +892,10 @@ class Camera:
886
892
  thickness: float,
887
893
  pixel_array: np.ndarray,
888
894
  ):
889
- """Displays a PMobject by modifying the Pixel array suitably..
895
+ """Displays a PMobject by modifying the pixel array suitably.
896
+
890
897
  TODO: Write a description for the rgbas argument.
898
+
891
899
  Parameters
892
900
  ----------
893
901
  pmobject
@@ -957,7 +965,7 @@ class Camera:
957
965
  The Pixel array to put the imagemobject in.
958
966
  """
959
967
  corner_coords = self.points_to_pixel_coords(image_mobject, image_mobject.points)
960
- ul_coords, ur_coords, dl_coords = corner_coords
968
+ ul_coords, ur_coords, dl_coords, _ = corner_coords
961
969
  right_vect = ur_coords - ul_coords
962
970
  down_vect = dl_coords - ul_coords
963
971
  center_coords = ul_coords + (right_vect + down_vect) / 2
@@ -1122,17 +1130,19 @@ class Camera:
1122
1130
  ],
1123
1131
  )
1124
1132
 
1125
- def adjusted_thickness(self, thickness: float):
1126
- """
1133
+ def adjusted_thickness(self, thickness: float) -> float:
1134
+ """Computes the adjusted stroke width for a zoomed camera.
1127
1135
 
1128
1136
  Parameters
1129
1137
  ----------
1130
1138
  thickness
1139
+ The stroke width of a mobject.
1131
1140
 
1132
1141
  Returns
1133
1142
  -------
1134
1143
  float
1135
-
1144
+ The adjusted stroke width that reflects zooming in with
1145
+ the camera.
1136
1146
  """
1137
1147
  # TODO: This seems...unsystematic
1138
1148
  big_sum = op.add(config["pixel_height"], config["pixel_width"])
@@ -1141,7 +1151,8 @@ class Camera:
1141
1151
  return 1 + (thickness - 1) * factor
1142
1152
 
1143
1153
  def get_thickening_nudges(self, thickness: float):
1144
- """
1154
+ """Determine a list of vectors used to nudge
1155
+ two-dimensional pixel coordinates.
1145
1156
 
1146
1157
  Parameters
1147
1158
  ----------
@@ -1215,13 +1226,16 @@ class Camera:
1215
1226
  # NOTE: The methods of the following class have not been mentioned outside of their definitions.
1216
1227
  # Their DocStrings are not as detailed as preferred.
1217
1228
  class BackgroundColoredVMobjectDisplayer:
1229
+ """Auxiliary class that handles displaying vectorized mobjects with
1230
+ a set background image.
1231
+
1232
+ Parameters
1233
+ ----------
1234
+ camera
1235
+ Camera object to use.
1236
+ """
1237
+
1218
1238
  def __init__(self, camera: Camera):
1219
- """
1220
- Parameters
1221
- ----------
1222
- camera
1223
- Camera object to use.
1224
- """
1225
1239
  self.camera = camera
1226
1240
  self.file_name_to_pixel_array_map = {}
1227
1241
  self.pixel_array = np.array(camera.pixel_array)