Commit graph

557 commits

Author SHA1 Message Date
Grant Sanderson
a3e76334a6 Nix shade_in_3d stuff 2020-06-05 13:22:53 -07:00
Grant Sanderson
b4fb0955a6 Get rid of sheen factor 2020-06-05 13:21:59 -07:00
Grant Sanderson
cacfe67fe1 ParametricSurface replaces the role of SurfaceMobject, and instead of tracking normals infinitesimal nudges are tracked 2020-06-05 11:12:52 -07:00
Grant Sanderson
a62a4ae02b Make sure Point has points of type float 2020-06-05 11:11:46 -07:00
Grant Sanderson
2b931dc7a2 Improvements to surfaces, with textured surfaces available 2020-06-04 17:17:38 -07:00
Grant Sanderson
4c33b99d39 Very rudimentary 3dSurface type 2020-06-04 15:41:20 -07:00
Grant Sanderson
e4419204cb Got stroke shaders working in 3d 2020-06-04 11:29:36 -07:00
Grant Sanderson
23bbdc63ba Fix up fill shaders to work when being viewed from different orientations, along with several other little bugs 2020-06-03 17:10:33 -07:00
Grant Sanderson
38cc0a7174 Added glossiness to VMobjects 2020-06-02 16:18:44 -07:00
Grant Sanderson
725a7e3121 Enable 3d rotations 2020-06-01 16:21:18 -07:00
Grant Sanderson
00dcc14df1 Fixed the random-dimples-on-zeros bug while fixing up the fill shaders 2020-05-31 17:02:05 -07:00
Grant Sanderson
270e93f6f0 Merge 2020-05-30 16:53:53 -07:00
Grant Sanderson
593c249bbd Tiny comment 2020-05-30 16:49:27 -07: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
鹤翔万里
d83fa90606
Fix Text Class's bugs in shaders branch (the same as #1030) (#1031)
* 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

* fix typo in text_mobject.py

* fix conflict of default size and height
2020-05-07 01:21:43 -07: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
Grant Sanderson
6e523ed960 Clearer defaults 2020-04-12 09:54:13 -07:00
Grant Sanderson
94c121bcf7 Default arrange_in_grid should have it draw rows first 2020-04-07 12:36:17 -07:00
Grant Sanderson
8384b8b46b Fix bug with clock 2020-03-27 12:04:30 -07:00
Grant Sanderson
7c0bf2c015 Add args to VMobject.flip 2020-03-27 12:04:16 -07:00
Grant Sanderson
f7ad9e71e0 Separate time_based_updaters and non_time_updaters 2020-03-19 10:46:50 -07:00
Grant Sanderson
23440d020f Add pfp as abreviation for point_from_proportion 2020-03-14 16:53:02 -07:00
Grant Sanderson
627f122b3f Remove VMobject.set_fill defaulting 2020-03-13 14:05:34 -07:00
Solara570
99519090fb Small fix to NumberPlane construction 2020-03-08 17:12:38 +08:00
Grant Sanderson
0ad64329f6 Fix to NumberPlane 2020-03-06 06:17:12 -08:00
Grant Sanderson
ace2b7fea4 Don't deepcopy parents 2020-03-06 06:16:52 -08:00
Grant Sanderson
f83cfc42b1 Fix set_fill 2020-03-06 06:16:28 -08:00
Grant Sanderson
06123f956a Don't deepcopy Arrow by default 2020-02-27 17:19:50 +00:00
Grant Sanderson
ed1cbe32ff Don't copy a mobject's parents 2020-02-27 17:19:15 +00:00
Grant Sanderson
6593eab9a0 Change default stroke width of number line 2020-02-27 17:18:10 +00:00
Grant Sanderson
6e0ae83685 Small fixes 2020-02-27 17:17:53 +00:00
Grant Sanderson
40b651d661 Reformat 2020-02-27 17:17:33 +00:00
Grant Sanderson
3cc9bf7052 Bug fix to refresh_triangulation 2020-02-27 17:17:10 +00:00
Grant Sanderson
8485ff8c76 Have vmob.set_opacity default to opacity 1 if it's not specified 2020-02-23 22:59:11 +00:00
Grant Sanderson
8159f701f4 Typo fix 2020-02-23 22:58:47 +00:00
Grant Sanderson
d794ff8bc9 Revert last change 2020-02-23 22:58:34 +00:00
Grant Sanderson
26dccfe9a7 Make input_to_graph_point always use a binary search, since graph's have uneven density now 2020-02-23 22:56:50 +00:00
Grant Sanderson
ed6085d07c Add replace_submobject 2020-02-22 13:19:51 -08:00
Grant Sanderson
11a4d7696e Change implementation of pointwise_become_partial not to change the number of points 2020-02-22 13:19:26 -08:00
Grant Sanderson
2ca0726cd7 Add self.shader_data_is_locked condition to get_shader_info_list 2020-02-21 12:01:17 -08:00
Grant Sanderson
68ac16e5fb Move rendering back to camera 2020-02-21 12:00:34 -08:00