546 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
c667136060 Fix error when using VFadeIn (and its subclasses) (#2328)
* Fix error when using VFadeIn and its subclasses

* add np.floating in type checking of Mobject.set_rgba_array_by_color and VMobject.set_stroke and removing the change in VFadeIn
2025-06-10 08:04:13 -07:00
db421e3981 Video work (#2318)
* 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
2025-02-26 07:52:59 -08: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
744e695340 Misc. clean up (#2269)
* 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
2024-12-12 08:39:54 -08:00
7d3758c44c Move joint_type_map out of constants to VMobject 2024-12-10 19:33:06 -06:00
c51a84a6ee Fixing a Cairo Bug (Windows OS) 2024-12-11 00:10:06 +05:30
54c8a9014b Add scale_stroke_with_zoom option to VMobject 2024-11-25 11:27:11 -07:00
09e9e65ba4 Merge branch 'master' of github.com:3b1b/manim into video-work 2024-10-01 13:29:42 -05:00
641c03a95b Change condition for updating VMobject. outer_vert_indices 2024-10-01 13:27:02 -05:00
f737823bac Add VMobject. get_shader_vert_indices 2024-10-01 13:20:23 -05:00
95bb67c47f Change return type for Mobject.get_shader_data 2024-10-01 13:18:40 -05:00
512fb89726 Save VMobject. outer_vert_indices 2024-10-01 13:14:24 -05:00
f0bf50eb7f Remove use of gl_VertexID 2024-09-28 09:54:28 -05:00
1f8ad5be16 Fix pfp for null curves 2024-09-21 12:17:10 -04:00
95fca885c9 Push clip plane functionality up to all Mobjects 2024-09-17 17:20:19 -05:00
8eac976c8d Tweak moderngl import in ImageMobject 2024-09-06 13:35:32 -05:00
9011c864fd Merge pull request #2061 from floatwoozy/dev
Error effect when rendering the same ImageMobject
2024-09-06 09:35:31 -07:00
76fdd02db0 Go back to default fill border width of 0, except for String 2024-09-06 09:17:28 -05:00
054261d86f Add zero point edge case for point_from_proportion 2024-08-29 14:10:37 -05:00
04d77f2bec Fix joint angle for lines 2024-08-28 11:57:23 -05:00
22a6b47ec9 Always recompute unit normals on rotate 2024-08-26 11:46:43 -05:00
5cf5e497e7 Don't have joint_angles, unit_normal and path_end_indices get refreshed for shift/scale/rotate
Change unit_normal directly in rotate
In general, don't trigger refresh on apply_points_function
2024-08-26 11:41:32 -05:00
36ea70d990 Remove whitespace 2024-08-26 09:14:53 -05:00
cd5c436ce4 Tighter (albeit arbitrary) constraint on path end detection
This is really not great
2024-08-26 09:14:42 -05:00
827f4db5e2 Clarify where normal is being inverted 2024-08-26 09:13:39 -05:00
8785eb1844 Don't have quiet default changes to stroke_behind 2024-08-23 14:46:34 -05:00
566fc87a60 Don't keep an outer_vert_indices attribute 2024-08-23 14:11:05 -05:00
499803159c Remove methods and tracking associated with triangulation and non-winding fill 2024-08-23 14:08:56 -05:00
e939e1de09 Tweak the correction for angle_diffs in get_joint_angles 2024-08-23 13:56:08 -05:00
c26ebfc10f Have is_closed use the last path 2024-08-23 13:55:42 -05:00
a08523d746 Fix get_subpath_end_indices_from_points 2024-08-23 13:29:31 -05:00
bcafcbf490 Don't have VMobject refresh joint angles on shift, scale and rotate 2024-08-23 12:32:17 -05:00
9a7bfdd1c9 For Surface, calculate normals with neighboring points 2024-08-22 15:21:40 -05:00
c8d5e91422 Rename shader_dtype -> data_dtype 2024-08-22 14:52:35 -05:00
eda7f81fb9 Update VMobject.is_smooth 2024-08-21 17:22:34 -05:00
d5575cf1ef Change how joint_angles are computed 2024-08-21 17:19:42 -05:00
442206faad Go back to non-flat-stroke as the default 2024-08-21 16:05:02 -05:00
eea8416d57 Default to allowing null lines, except for SVGPaths 2024-08-21 14:44:33 -05:00
b3386ad7a7 Add an option for VMobject.add_line to add a null line 2024-08-21 14:29:40 -05:00
c83d03aeb7 Simplify get_subpath_end_indices_from_points 2024-08-21 14:29:16 -05:00
0a89725090 Tweaking what triggers refreshes 2024-08-21 13:57:54 -05:00
0cb7a8f691 Only recompute subpath_end_indices as needed 2024-08-21 13:44:24 -05:00
43f1704f69 Fix computation of joint_angles to handle zero division case 2024-08-21 13:44:00 -05:00
941513d68c Only recompute VMobject.get_unit_normal as needed 2024-08-21 12:26:42 -05:00
9a5386b022 Instead of passing in joint_products to stroke shader, just track joint_angles and pass in global unit normal 2024-08-21 11:59:48 -05:00
748780378b Have stroke_behind default to True for VMobjects with fill and no stroke 2024-08-21 08:43:57 -05:00
d0cb5b4eea Fix normal orientation on Surface 2024-08-20 14:47:47 -05:00
910f28f52e Don't have a default flat stroke in set_style 2024-08-20 12:13:18 -05:00
7474ae17b0 Change default to flat stroke, except in 3d situations 2024-08-20 11:52:05 -05:00