51 Commits

Author SHA1 Message Date
fd2a6a69e5 Created a method `remove_all_except()` in scene.py and interactive_scene.py, and made default colors easily configurable. (#2346)
* created a method remove_all_except() in scene.py and interactive_scene.py

* Made it such that default mobject colors can be set through the yaml config file.

* * Default color initialisation wasn't working.
Changed conditional expression to `or` instead.

* Added default values to yaml file.

* added set_background_color() function to Scene class

* Changed default font back to Consolas
2025-06-10 08:15:55 -07:00
c7ef8404b7 Video work (#2356)
* Only use -no-pdf for xelatex rendering

* Instead of tracking du and dv points on surface, track points off the surface in the normal direction

This means that surface shading will not necessarily work well for arbitrary transformations of the surface. But the existing solution was flimsy anyway, and caused annoying issues with singularity points.

* Have density of anchor points on arcs depend on arc length

* Allow for specifying true normals and orientation of Sphere

* Change miter threshold on stroke shader

* Add get_start_and_end to DashedLine

* Add min_total_width option to DecimalNumber

* Have BackgroundRectangle.set_style absorb (and ignore) added configuration

Note, this feels suboptimal

* Add LineBrace

* Update font_size adjustment in Tex

* Add scale_factor parameter to BulletedList.fade_all_but

* Minor import tweaks

* Add play_sound

* Small if -> elif update

* Always use Group for FadeTransform

* Use time_spanned_alpha in ChangingDecimal

* Change priority of number_config vs. self.decimal_number_config in NumberLine init

* Fix clock animation

* Allow sample_coords to be passed into VectorField
2025-06-10 08:02:32 -07:00
dbfe7ac75d Performance improved in set_color_by_rgba_func (#2316)
* removing 1 in neg axis if unit_tex is specified

* performance improved in `set_color_by_rgba_func`

* resolving imag axis number mob in ComplexPlane
2025-03-20 11:56:29 -07:00
7a61a13691 Fix issues in number_line.py (#2310)
Fix the issue that changes in decimal_number_config["font_size"] get rewritten by number_config
2025-03-20 11:54:59 -07:00
96d44bd560 Video work (#2284)
* Comment tweak

* Directly print traceback

Since the shell.showtraceback is giving some issues

* Make InteracrtiveSceneEmbed into a class

This way it can keep track of it's internal shell; use of get_ipython has a finicky relationship with reloading.

* Move remaining checkpoint_paste logic into scene_embed.py

This involved making a few context managers for Scene: temp_record, temp_skip, temp_progress_bar, which seem useful in and of themselves.

* Change null key to be the empty string

* Ensure temporary svg paths for Text are deleted

* Remove unused dict_ops.py functions

* Remove break_into_partial_movies from file_writer configuration

* Rewrite guarantee_existence using Path

* Clean up SceneFileWriter

It had a number of vestigial functions no longer used, and some setup that could be made more organized.

* Remove --save_pngs CLI arg (which did nothing)

* Add --subdivide CLI arg

* Remove add_extension_if_not_present

* Remove get_sorted_integer_files

* Have find_file return Path

* Minor clean up

* Clean up num_tex_symbols

* Fix find_file

* Minor cleanup for extract_scene.py

* Add preview_frame_while_skipping option to scene config

* Use shell.showtraceback function

* Move keybindings to config, instead of in-place constants

* Replace DEGREES -> DEG

* Add arg to clear the cache

* Separate out full_tex_to_svg from tex_to_svg

And only cache to disk the results of full_tex_to_svg.  Otherwise, making edits to the tex_templates would not show up without clearing the cache.

* Bug fix in handling BlankScene

* Make checkpoint_states an instance variable of CheckpointManager

As per https://github.com/3b1b/manim/issues/2272

* Move resizing out of Window.focus, and into Window.init_for_scene

* Make default output directory "." instead of ""

To address https://github.com/3b1b/manim/issues/2261

* Remove input_file_path arg from SceneFileWriter

* Use Dict syntax in place of dict for config more consistently across config.py

* Simplify get_output_directory

* Swap order of preamble and additional preamble

* Minor stylistic tweak

* Have UnitInterval pass on kwargs to NumberLine

* Add simple get_dist function

* Have TracedPath always update to the stroke configuration passed in

* Have Mobject.match_points apply to all parts of data in pointlike_data_key

* Always call Mobject.update upon adding an updater

* Add Surface.uv_to_point

* Make sure Surface.set_opacity takes in a recurse option

* Update num_tex_symbols to account for \{ and \}
2024-12-26 09:35:34 -08:00
7edc4b64ad Replace numbers_with_elongated_ticks -> big_tick_numbers 2024-02-22 11:47:28 -08:00
e784c42f0d Add big_tick_spacing option NumberLine 2024-02-22 11:45:31 -08:00
1eb819363d Fix issue with ticks going beyond number line 2023-02-24 08:23:01 -05:00
2290f810ca Small tweaks to number_to_point 2023-01-19 20:25:29 -08:00
c96cdf43a1 Make sure mutability of dict arguments won't cause problems
One could argue that a pattern of "arg: dict | None = None" followed by "self.param = arg or dict()" is better, but that would make for an inconsistent pattern in cases where the default argument is not None.
2022-12-18 09:38:28 -08:00
97f28b34f3 Distinguish Vect3 from Vect3Array types 2022-12-17 13:16:48 -08:00
dec11a4b17 Rename np_vector type to Vect3 or Vect4 to make context clearer 2022-12-16 20:35:26 -08:00
43fd5e1aea Move custom type to manimlib.typing 2022-12-16 20:19:18 -08:00
c00af3c1bf Rename config_ops -> dict_ops 2022-12-16 18:59:23 -08:00
afab37c2d2 Remove stray digest_config references 2022-12-16 11:00:59 -08:00
9039fe69e4 Kill CONFIG in number_line.py 2022-12-15 20:26:10 -08:00
faa37844e7 Add unit_tex option for NumberLine.add_numbers 2022-11-03 11:32:25 -07:00
cbb7e69f68 Refactor LabelledString and relevant classes 2022-04-18 18:47:57 +08:00
9ef9961d0e Sort imports 2022-04-12 19:19:59 +08:00
dc4b9bc93c Use outer_interpolate for NumberLine.number_to_point 2022-04-11 10:47:26 -07:00
a9349057ad Merge branch 'master' of github.com:3b1b/manim into video-work 2022-03-22 11:30:25 -07:00
c3e13fff05 Allow Numberline.number_to_point to work on an array of numbers 2022-03-16 12:24:03 -07:00
4c16bfc2c0 chore: add type hints to manimlib.mobject 2022-02-15 14:37:15 +08:00
3b146636b4 Use isclose in place of of == 0 2021-08-26 11:43:44 -07:00
0b7b3f4f31 Improve NumberLine.p2n speed 2021-08-21 17:07:05 -07:00
de9ecbd766 Remove unnecessary import 2021-03-31 23:24:55 -07:00
8345ca6160 Small fixes to NumberLine 2021-03-18 17:37:12 -07:00
97e7b0568e Add default font_size to NumberLine.add_numbers 2021-02-07 17:30:31 -08:00
6f69902892 Changed how configuration for labels on a NumberLine, and hence also on Axes, so that it takes in DecimalNumber configuration directly rather than as a separte dict. 2021-02-06 11:06:38 -08:00
03bea8198c Fix NumberLine's unit_size 2021-02-06 15:05:18 +05:30
2a3db89a2d merge 2021-02-05 15:29:18 -08:00
f786eb68d1 Change default decimal_number_config for NumberLine 2021-02-05 15:27:29 -08:00
269128dfb6 fix NumberLine and GraphScene 2021-02-05 13:57:00 +08:00
fb8280171b Replace redundant CONFIG key in NumberLine 2021-02-01 12:25:11 +05:30
3b26a6c260 Clean up colors, e.g. replacing LIGHT_GREY and DARK_GREY with GREY_B and GREY_D 2021-01-02 22:44:53 -08:00
4385fc75d0 Change TipableVMobject to take in all tip_config at one spot 2020-06-06 10:56:23 -07:00
1a5fb207ae Reconfigured how to initialize axes and number planes. Hopefully much more sensible this way 2020-06-05 19:24:35 -07:00
5c23e93547 Reconfigure NumberLine, the whole interface felt very weird 2020-06-05 17:57:21 -07:00
6593eab9a0 Change default stroke width of number line 2020-02-27 17:18:10 +00:00
a3c1640fb7 NumberLine.default_numbers_to_display was not showing topmost number it should have 2019-06-25 09:03:33 -07:00
644ac5c94a Added abbreviated names for number_to_point and point_to_number 2019-04-09 18:51:18 -07:00
6b59cdcd37 Fixed issue with numberline last tick vs. arrow conflict 2019-03-30 13:22:53 -07:00
ec1436ef5a Changed default for Interval numbering 2019-03-25 16:43:16 -07:00
97c8ea2738 Small bug fix to NumberLine 2019-03-23 10:52:25 -07:00
27200f79d3 Add last tick to number line 2019-03-20 17:38:11 -07:00
312e9c460b Add an option to not display zero by default 2019-02-11 22:24:17 -08:00
1735f16d68 Fixed NumberLine bug 2019-02-11 22:14:00 -08:00
e3ee258d91 Replaced merge_config with merge_dicts_recursively 2019-02-06 21:32:42 -08:00
d88c301622 Updating coordinate system mobjects 2019-02-06 21:16:26 -08:00
24d6113bba Get rid of propagate_style_to_family, since it is basically always true 2019-02-06 16:25:03 -08:00