Commit graph

84 commits

Author SHA1 Message Date
Grant Sanderson
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
Varniex
c51a84a6ee Fixing a Cairo Bug (Windows OS) 2024-12-11 00:10:06 +05:30
Grant Sanderson
94f6f0aa96
Cleaner local caching of Tex/Text data, and partially cleaned up configuration (#2259)
* Remove print("Reloading...")

* Change where exception mode is set, to be quieter

* Add default fallback monitor for when no monitors are detected

* Have StringMobject work with svg strings rather than necessarily writing to file

Change SVGMobject to allow taking in a string of svg code as an input

* Add caching functionality, and have Tex and Text both use it for saved svg strings

* Clean up tex_file_writing

* Get rid of get_tex_dir and get_text_dir

* Allow for a configurable cache location

* Make caching on disk a decorator, and update implementations for Tex and Text mobjects

* Remove stray prints

* Clean up how configuration is handled

In principle, all we need here is that manim looks to the default_config.yaml file, and updates it based on any local configuration files, whether in the current working directory or as specified by a CLI argument.

* Make the default size for hash_string an option

* Remove utils/customization.py

* Remove stray prints

* Consolidate camera configuration

This is still not optimal, but at least makes clearer the way that importing from constants.py kicks off some of the configuration code.

* Factor out configuration to be passed into a scene vs. that used to run a scene

* Use newer extract_scene.main interface

* Add clarifying message to note what exactly is being reloaded

* Minor clean up

* Minor clean up

* If it's worth caching to disk, then might as well do so in memory too during development

* No longer any need for custom hash_seeds in Tex and Text

* Remove display_during_execution

* Get rid of (no longer used) mobject_data directory reference

* Remove get_downloads_dir reference from register_font

* Update where downloads go

* Easier use of subdirectories in configuration

* Add new pip requirements
2024-12-05 14:51:14 -08:00
Varniex
5d3f730824
Cleaning up some imports + Minor Bug fixed in VectorField (#2253)
* cleaning up imports

* sample_points -> sample_coords
2024-12-05 14:42:46 -08:00
Grant Sanderson
e19ceaaff0 Have TexMobject keep track of font_size 2024-11-25 11:02:54 -07:00
Grant Sanderson
7e6a37d499 Typo fix: make_number_changable -> make_number_changeable 2024-03-21 10:03:41 -03:00
Grant Sanderson
3aa9eb6372 Add String.get_symbol_substrings and Tex.get_symbol_substrings 2022-12-30 15:07:41 -08:00
Grant Sanderson
0f9adbf91c Add Tex.make_number_changable 2022-12-29 18:52:00 -08:00
Grant Sanderson
33682b7199 MTex is the new Tex, Tex is now OldTex
Global replace
Tex -> OldTex
TexText -> OldTexText
MTex -> Tex
MTexText -> TexText
2022-12-21 13:18:20 -08:00
Grant Sanderson
3293f72adc Move BulletedList, TexTextFromPresetString and Title to their own file 2022-12-20 14:48:54 -08:00
Grant Sanderson
e0e7e24351 Move display_during_execturion call
Such that it only gets called when a new svg needs to be written
2022-12-19 17:01:06 -08:00
Grant Sanderson
c2c8149627 Revert "Move display_during_exection associated with Latex rendering"
This reverts commit ab470c3ee5.
2022-12-19 16:54:55 -08:00
Grant Sanderson
a53867d8a1 Fix TexText bug 2022-12-19 16:54:44 -08:00
Grant Sanderson
ab470c3ee5 Move display_during_exection associated with Latex rendering
Only have it display when a new SVG is being written
2022-12-19 16:19:43 -08:00
Grant Sanderson
2c20a1509e Remoe height defaults form __init__args of SingleStringTex and String 2022-12-19 14:43:10 -08:00
Grant Sanderson
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
Grant Sanderson
43fd5e1aea Move custom type to manimlib.typing 2022-12-16 20:19:18 -08:00
Grant Sanderson
afab37c2d2 Remove stray digest_config references 2022-12-16 11:00:59 -08:00
Grant Sanderson
a3215d0354 Fix small height bug 2022-12-15 12:48:27 -08:00
Grant Sanderson
7aa5c83a14 Kill CONFIG in tex_mobject.py 2022-12-15 11:33:00 -08:00
Grant Sanderson
958002152e Define ManimColor type in constants 2022-12-14 10:55:32 -08:00
YishiMichael
bc939fdd5b
Rename font to template 2022-05-28 23:18:56 +08:00
YishiMichael
59eba943e5
Resolve conflicts 2022-05-28 12:43:53 +08:00
YishiMichael
9386461d27
Add font attribute for Tex 2022-05-22 23:47:45 +08:00
YishiMichael
f0984487ea
Construct TexTemplate class to convert tex to svg 2022-05-21 15:56:03 +08:00
Grant Sanderson
354030464e Bug patch Tex sometimes rendering black 2022-04-28 19:15:53 -04:00
YishiMichael
9ef9961d0e
Sort imports 2022-04-12 19:19:59 +08:00
EbbDrop
2277679111 Added a \overset as a special string 2022-04-08 23:06:08 +02:00
YishiMichael
6ad8636fab
Adjust some typings (#1765)
* Adjust some typings

* Adjust typings
2022-03-23 14:17:34 +08:00
TonyCrane
9f3b404df6
resolve conflict and add type hints for it 2022-02-16 11:46:55 +08:00
YishiMichael
0cab23b2ba
Reorganize inheriting order of SVGMobject 2022-02-15 20:16:15 +08:00
TonyCrane
773e013af9
chore: add type hints to manimlib.mobject.svg 2022-02-14 22:55:41 +08:00
Grant Sanderson
602809758e
Video work (#1739)
* Enable setting points to a null list, and adding one point at a time.

* Add refresh_locked_data

* Add presenter mode to scenes with -p option

* Allow for an embed by hitting e during interaction

* Add set_min_height, etc.

* Make sure null parametric curve has at least one point

* Account for edge case where \{ is used in Tex

* Allow for logging notes in wait calls, useful for presenter mode

* Simplify choose, and add gen_choose for fractional amounts

* Default to no top on axes

* Allow match_x, match_y, etc. to take in a point

* Allow wait calls to ignore presenter mode

* Just use math.combo, no caching with choose(n, r)

* Use generator instead of list in bezier

* Bubble init_colors should override

* Account for "px" values read in from an svg

* Stop displaying when writing is happening

* Update the way Bubble override SVG colors
2022-02-13 15:16:16 -08:00
YishiMichael
67f5b10626
Attempt to refactor SVGMobject with svgelements (#1731)
* Some small refactors

* Refactor MTex

* Implement TransformMatchingMTex

* Some refactors

* Some refactors

* Some small refactors

* Strip strings before matching

* Implement get_submob_tex

* Use RGB color mode

* Some small refactors

* Try refactoring SVGMobject with svglib

* Refactor SVGMobject using svgelements

* Refactor SVGMobject using svgelements

* Use functions instead of func names as dict values

* style: modify import order to conform to PEP8

* Set default values to None

* modify import order

* Remove unused import

Co-authored-by: TonyCrane <tonycrane@foxmail.com>
2022-02-11 07:53:21 -08:00
TonyCrane
ebb75d1235
cached SVGMobject in SingleStringTex with default color 2022-01-26 20:37:44 +08:00
TonyCrane
9af23415a2
synchronize SingleStringTex's color to SVGMobject 2022-01-26 20:20:48 +08:00
TonyCrane
833e40c2d4
fix default style 2022-01-26 19:50:27 +08:00
Michael W
4d91ff3f2f
Update balance_braces method 2021-10-24 23:21:49 +08:00
Grant Sanderson
1bca0e63e9 Remove unnecessary import 2021-10-01 12:32:20 -07:00
Grant Sanderson
e9ea5fbea0
Merge pull request #1481 from libinglong/lbl-fix-tex
fix issue #1480
2021-06-14 09:50:20 -07:00
Grant Sanderson
d279272762 Small cleanup for TexMobject, and remove {{ }} separation convention 2021-04-28 08:50:50 -07:00
libinglong
29e5a8bc90 fix issue #1480 2021-04-17 22:30:08 +08:00
Grant Sanderson
c45ff910f0 Remove double brace convention, since it causes errors with a number of tex strings 2021-04-08 14:46:03 -07:00
Grant Sanderson
e95aa69c4c Change arg_separator default 2021-03-31 23:22:54 -07:00
Grant Sanderson
3c0f8abe5f Only display writing message when a new tex file is actually being written 2021-01-30 22:12:44 -08:00
Grant Sanderson
e218105f73 Merge custom defaults recursively rather than overriding manim's with the local one 2021-01-18 10:58:33 -08:00
Grant Sanderson
f91c81dd6a Rename TexMobject -> Tex and TextMobject -> TexText 2021-01-18 08:20:14 -10:00
Grant Sanderson
d65a915e7b Initialize colors properly with new TexMobject structure 2021-01-13 08:18:24 -10:00
Grant Sanderson
bf3571c103 Have DecimalMobject look to the same cache that TexMobjects do 2021-01-13 00:24:40 -10:00
Grant Sanderson
6537258f24 Cache already computed TexMobjects 2021-01-13 00:11:27 -10:00