Commit graph

224 commits

Author SHA1 Message Date
techdude
384304e92b Add CONFIG parameter to allow disabling smoothing 2021-01-31 18:48:48 -07:00
鹤翔万里
53756ea140
Merge pull request #1112 from vivek3141/patch-1
Add dot_color to BulletedList
2020-09-30 23:27:29 +08:00
鹤翔万里
dcb608f258
Merge pull request #1072 from Tony031218/change-coord-color
Allow Axes to change the color of coordinate labels
2020-09-30 23:26:59 +08:00
鹤翔万里
05acf31e47
Merge pull request #1064 from Erik-White/numberline
Correctly return get_unit_size
2020-09-30 23:21:56 +08:00
鹤翔万里
bc5c3968d9
Merge pull request #1043 from kuk0/get_merged_array
remove superfluous code
2020-09-30 23:21:05 +08:00
鹤翔万里
11c451c2e9
Merge pull request #1038 from peninha/patch-1
Corrected a bug in stretch_to_fit_depth function
2020-09-30 23:19:26 +08:00
dummy26
37efc93e9c
Fix a typo in mobject.py (#847) 2020-09-30 23:03:57 +08:00
鹤翔万里
d63f61b903
Merge pull request #909 from Solara570/numberplane-fix
Small fix to NumberPlane construction
2020-09-30 23:01:49 +08:00
Vivek Verma
82d6ad0ef5
Add dot_color to BulletedList 2020-05-28 11:19:08 -07:00
applemonkey496
45c5ec7091
Add missing import to brace.py
Without `import copy` lines 128 to 131 will throw an error. I've tested this edit in my local version of the library and it fixes the bug.
2020-05-20 20:07:13 -07:00
Tony031218
4d78e0c63e fix changing coordinates color 2020-05-15 12:36:55 +08:00
NavpreetDevpuri
cf656e9c21
Code() in file Code_mobject.py to display code with color highlighted added Paragraph() and "exact_spaces" parameter to Text() (#1036) 2020-05-13 22:19:09 -07:00
Erik White
f3f9d0dfb7 Correctly return get_unit_size 2020-05-13 19:15:01 +03:00
Kubo Kovac
2f26a32f96 remove superfluous code 2020-05-10 14:58:01 +02:00
peninha
6a571262fd
Corrected a bug in stretch_to_fit_depth function 2020-05-10 01:40:21 -03:00
XiaoYoung
522a5b3c5f
Fix space characters problem of Text (#1035)
* Fix Text wrong display

* Fix space characters problem of Text

* Fix a potential bug using height or width in Text

* Update Text

* Fix typo in text_mobject.py
2020-05-07 01:16:39 -07:00
鹤翔万里
3362f93964
Fix three bugs(shaders/stroke/size) of Text Class (text_mobject.py) (#1030)
* fix: remove the last M tag in svg files to make Text run in shaders branch

* fix: close the svg path manually to fix the bug of wrong stroke

* fix: remove Space mobjects in Text to fix the bug of TransformText

* feat: make Text and TextMobject equal in size

* this will lead to more bugs of setting color, so I delete it
2020-05-05 00:12:22 -07:00
Mike Magruder
af65c9d5d4
Performance improvement for most scenes (#974)
tl;dr: this is a significant performance improvement for many scenes. 1.7x - 2.6x improvement in animation it/s.

This is a small change to some of the hotest paths in rendering objects. The biggest win comes from not using np.allclose() to check if two points are close enough. In general, NumPy is awesome at operating on large arrays, but overkill for very tiny questions like this. Created a small function to determine if two points are close using the same algorithm, and limited it to 2D points since that's all we need in set_cairo_context_path().

A couple of other minor tweaks to reduce or eliminate other uses of NumPy in this path.

In general, it is better to avoid wrapping lists in np.array when a real NumPy array isn't actually needed.

Added a new file for performance test scenes, with a single scene from the end of a video I've been working on.

Data:

MacBook Pro (16-inch, 2019)
macOS Catalina 10.15.4
2.4 GHz 8-Core Intel Core i9
64 GB 2667 MHz DDR4
Python 3.7.3 (default, Mar  6 2020, 22:34:30)

Profiler: yappi under Pycharm.

Using the scene Perf1 from the included perf_scenes.py, averaged over 5 runs and rendered with:
manim.py perf_scenes.py Perf1 -pl --leave_progress_bars

Before:
Animation 0: FadeInTextMobject, etc.:               8.93it/s
Animation 1: ShowCreationParametricFunction, etc.: 84.66it/s

Profiler shows 48.5% of the run spent under Camera.set_cairo_context_path()

After
Animation 0: FadeInTextMobject, etc.:               23.45it/s  -- 2.63x improvement
Animation 1: ShowCreationParametricFunction, etc.: 149.62it/s  -- 1.77x improvement

Profiler shows 19.9% of the run spent under Camera.set_cairo_context_path()

Less improvement with production-quality renders, and percent improvement varies with scene of course. This appears to be a good win for every scene I'm working on though. I hope it will be for others, too.

NB: there are more perf improvements to be had, of course, but this is the best one I currently have.
2020-04-24 21:04:08 -07:00
XiaoYoung
f0cdcd90ba
Fix Text wrong display (#889) 2020-04-23 20:36:57 -07:00
Solara570
99519090fb Small fix to NumberPlane construction 2020-03-08 17:12:38 +08:00
azarzadavila
97a0a707d7 Typo in super() 77acc99 2020-02-09 11:31:54 +01:00
Grant Sanderson
77acc999cd Rename number_line_config to axis_config 2020-01-15 15:40:30 -08:00
Grant Sanderson
0f71b0a408 Playing wiht logo 2020-01-11 17:13:02 -08:00
Grant Sanderson
c2838d78a2 Forgot to propagate kwargs in Underline 2019-12-12 14:40:08 -08:00
Grant Sanderson
fc28375e42 Changed modification for tex mobjects that begin with a newline, which involved eliminating alignment when a TexMobject creates many SingleStringTexMobject to figure out how to divvy itself up 2019-12-10 13:39:25 -08:00
Grant Sanderson
f89bb3e125 Added Underline 2019-12-10 13:38:30 -08:00
Grant Sanderson
72006334f5 Added a small fix to the issue of Tex inputs starting with a new line 2019-12-06 17:10:51 -08:00
Grant Sanderson
94a3883880 Remove Mobject.print_family, as that is now in utils.debug 2019-12-06 17:10:26 -08:00
Grant Sanderson
975c4dd03c Explicitly check for None, rather than truthiness, for Axes.get_coordinate_labels 2019-11-12 11:55:19 -08:00
Devin Neal
1e3cf9fa78
Merge pull request #725 from Hammer7/master
Closes: #720
2019-11-06 16:21:23 -08:00
Devin Neal
ec9dd06d38
Merge pull request #748 from DzyubSpirit/fix-svg-width
Add default stroke width for the svg mobjects
2019-10-26 22:31:25 -07:00
DzyubSpirit
76c295a60b
Add default stroke width for the svg mobjects
Closes: #747
2019-10-08 10:32:04 +03:00
Grant Sanderson
8e15846ec5 Tiny clean to spacing 2019-09-26 11:04:35 -07:00
Grant Sanderson
557bbff36c Added PGroup 2019-09-24 14:40:21 -07:00
Grant Sanderson
42e0cd07ac Added support for changing and interpolating stroke_width on PMobjects 2019-09-19 13:38:46 -07:00
Hlaing Min
a19a6317ec Closes: #720
Fix to interpret subsequent points of absolute MoveTo (M) command as absolute LineTo (L).
2019-09-13 01:51:22 +08:00
xy-23
9b3e60f5ce Update some Text Mobject changes 2019-08-16 15:53:36 +08:00
xy-23
0983fa11be Update some Text Mobject changes 2019-08-12 14:40:42 +08:00
xy-23
e9fa188d42 New Text Mobject 2019-08-12 09:35:05 +08:00
xy-23
fd3721e050 new Text mobject 2019-08-06 21:05:37 +08:00
xy-23
057a92f92c new Text mobject 2019-08-05 22:53:15 +08:00
Grant Sanderson
c7e6d9d474
Merge pull request #611 from 3b1b/diffyq
Diffyq
2019-07-24 20:38:48 -07:00
Xiao Young
71b71f2d65 Solution of text rendering problem (#628)
Prevent unwanted space added between TextMobjects
2019-07-20 14:13:23 -07:00
Grant Sanderson
985ef4518f Bug fix 2019-07-03 11:07:55 -07:00
Grant Sanderson
a3c1640fb7 NumberLine.default_numbers_to_display was not showing topmost number it should have 2019-06-25 09:03:33 -07:00
Grant Sanderson
0a695dd442 Changed Arrow default 2019-06-25 09:02:56 -07:00
Grant Sanderson
f3048eb574 Fixed bug with Bubble 2019-06-23 16:26:05 -07:00
Grant Sanderson
48f38b8940 Line.put_start_and_end_on should return self 2019-06-23 16:25:48 -07:00
Grant Sanderson
a535c6917e Added p2n and n2p abreviations for ComplexPlane 2019-06-23 16:25:22 -07:00
Grant Sanderson
40e44e6dd7 Parametric surface should remember what function created it 2019-06-20 13:26:22 -07:00