Commit graph

207 commits

Author SHA1 Message Date
鹤翔万里
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
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
Grant Sanderson
2294cdea4f Allow Bubble to flip over any axis, which was unnecessarily restricted before 2019-06-19 16:08:14 -07:00
Grant Sanderson
8ce13875a3 Added Line.set_length 2019-06-19 16:07:22 -07:00
Grant Sanderson
6c2e7f4c2c interpolate_mobject should return self 2019-06-15 12:22:21 -07:00
Grant Sanderson
08eee147b3 Added TangentLine 2019-06-15 12:21:29 -07:00
Grant Sanderson
cfbbff1bdf Default color of Vector should be white 2019-06-13 16:14:03 -07:00
Grant Sanderson
cc08c090d1 Merge branch 'master' of github.com:3b1b/manim into diffyq 2019-06-13 09:29:57 -07:00
Grant Sanderson
542ddb9afd Make sure set_opacity changes background stroke as well 2019-06-13 09:26:34 -07:00
Grant Sanderson
6214ea7a01 Added TracedPath 2019-06-13 09:26:03 -07:00
Stephen Wild
41539387a5 Documentation for TipableVMobject
Add an overview of TipableVMobject's functionality and a few comments, as well as grouping some methods by functionality (roughly).
2019-06-10 03:36:16 +08:00
Devin Neal
f81c275631 make media, tex, and video directories configurable via flags 2019-06-04 20:51:18 -07:00
Devin Neal
caa4577cd1 reorganize media file tree 2019-06-03 23:41:05 -07:00
Grant Sanderson
d1e3e5ed20 Formatting correction 2019-05-27 19:48:14 -07:00
Grant Sanderson
828c3dcd7a Added c2p and p2c abbreviations to Axes 2019-05-27 19:47:57 -07:00
Grant Sanderson
4ccc65ca76
Merge pull request #513 from dor2727/ParametricFunctionAutoStepSize
smarter parameterized curve
2019-04-27 10:37:13 -07:00
dor2727
e611069a4a smarter parameterized curve 2019-04-27 18:39:22 +03:00
Grant Sanderson
76f61c504b Remove unnecessary import 2019-04-21 08:13:05 -07:00
Grant Sanderson
fd0030085b Added Mobject.match_updaters 2019-04-10 14:57:15 -07:00