Commit graph

98 commits

Author SHA1 Message Date
icedcoffeeee
239a7b3985
Implemented :meth:.Line3D.parallel_to and :meth:.Line3D.perpendicular_to (#2196)
* implemented parallel_to and perp_to class methods

* documentation

* tests

* renamed perp_to to perpendicular_to

* simplified calculations
2021-10-22 10:44:49 +00:00
Christopher Besch
3ce4c133dd
Introduced API for scene sections via :meth:.Scene.next_section (#2152)
* feat: added section class

* fix: fixed imports in scene.py

* feat: added section class

* fix: fixed imports in scene.py

* feat: scene file writer update; needs testing

* broken test

* fixed wrong partial movie files

* feat: added animation concatenation for sections

* fix: sections can contains None as partial movie file

* fix: correct section output file names

* fix: removed media folder

* feat: section output able to extract type

* feat: added guarantee_existence tests

* fix: touch file on windows

* fix: touch file on windows

* feat: automatically create control data with --set_test flag

* feat: added tests for sections output folder

* feat: added flag to enable sections

* feat: testing section metadata file

* feat: finished metadata tests; changed enums to be extendable

* fix: removed testing files

* fix: fixed section types

* fix: fixed outdated control data

* fix: fixed simple_scenes.py

* fix: fixed section type documentation example

* feat: added section video metadata to API

* fix: isort should stop destroying the import order for commands.py

* fix: fixed types of section metadata output

* fix: better comments

* ?

* feat: added elaborate test; switched name and type in next_section call

* feat: changed testing terminology: "config" got renamed to "movie metadata"

* fix: removed unicode lambda :<

* fix: fixed control data

* fix: removed test setter

* feat: added tutorial in the documentation

* fix: updated test control data

* fix: fixed double '.' in video tests

* fix: fixed some documentation

* fix: fixed missign JSON file in docs

* fix: implemented proposed changes

* fix: better --save_sections help

* fix: better docstrings

* fix: fixed last docstring...hopefully :>

* feat: custom section output supported

* fix: removed resolved todos

* fix: added debug for movie concatenation back

* fix: removed implemented TODO

* fix: removed doubled log

* fix: changed debug to info log

* fix: fixed log test data
2021-10-20 10:36:24 +02:00
icedcoffeeee
b8d76cfa7a
Implemented :class:~.ImplicitFunction and :meth:.CoordinateSystem.get_implicit_curve for plotting implicit curves (#2094)
* dependencies

* ImplicitFunction

* coord sys typo

* implicit graph

* tests

* lower max quads

* Update ImplicitFunction.npz

* corrections

* renamed graph to curve

* use_smoothing

* return type

* depth vs quads docs

* fix docstrings

* added more clarification

* updated note admonition

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Add keywords

* updated isosurfaces import

* unnecessary args as kwargs

* unnecessary args as kwargs

* Revert "updated isosurfaces import"

This reverts commit 16ac042a41.

* small fix

* Update poetry.lock

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-10-02 06:58:50 +00:00
leleogere
522b83cdc7
Improved the implementation of :meth:.CoordinateSystem.get_area to work without Riemann rectangles, added new :meth:.CoordinateSystem.get_area_with_riemann_rectangles (#1990)
* Rename old get_area

* Add the new get_area method

* Test file

* Revert "Test file"

This reverts commit 7588d7aba6.

* Fix the gradient coloring

* Add the bounded parameter

* Add an example and reformat the docstring

* Update get_area_with_riemann_rectangles example in the docstring

* Modify the example in the Example Gallery to use the new get_area

* Modify the test for get_area_with_riemann_rectangles and add a test for get_area

* Add the npz for the tests

* Rename bounded parameter in bounded_graph

* Make the function handle different range for graph and bounded_graph

* Use point instead of get_points()

* Make more specific tests

* Change Sequence type to Tuple

Co-authored-by: Hugues Devimeux <36239975+huguesdevimeux@users.noreply.github.com>

* Update an example to enhance the difference between both `get_area` methods

* Fix a bug not taking into acount x_range

* Change the opacity of the area in the example to better see the area

* Fix a bug for non-overlapping ranges

* Add the exception to the docstring

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove `get_area_with_riemann_rectangles` and fix f-strings

* Remove references to `get_riemann_rectangles`

Co-authored-by: Léo Géré <leo.gere@inrae.fr>
Co-authored-by: Léo Géré <gere@etud.insa-toulouse.fr>
Co-authored-by: Hugues Devimeux <36239975+huguesdevimeux@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-10-02 00:00:17 +00:00
Naveen M K
af462e83cc
Added support for Boolean Operations on VMobjects (#1998)
* Initial Progress

* pretty much done :)

* moved to class

* cleanup

* fix example, import and black

* Add skia-pathops dependency

* some docs

* Add Xor

* fix typo and remove stray print

* more docs

* remove stray example

* fix typo

* fix docs

* fix poetry

* fix typos

* Don't use SegmentIterator instead use RawPathIterator

* add tests

* black isort

* Minor cosmetics

* possibly fix tests

* small formatting changes

* small docs fix

* spacing

* Support more than 1 vmobject on Intersection

* Fix intersection of 3 or more Mobjects

* Add a test case for 3 mobject intersection

* black

* fix condition of undefined variable

* fix some typos

* Apply suggestions from code review

Co-authored-by: Darylgolden <darylgolden@gmail.com>
2021-09-28 11:35:33 +08:00
GameDungeon
94821c10d8
Flake8 Changes + Fixing Warnings (#1968)
* Warning Removal

* Flake Stuff

* HotFix

* Docs Fix

* I'm Dumb

* Docs Fix 2

* Fixing Github Requests

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* quick fix

* Add Deprecation Warning

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Weird Pre Commit Stuff

* Quick Fix

* Quick Fix

* Fix

* Flake Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-09-03 13:45:48 -04:00
icedcoffeeee
73f87bd66a
Implementing a `Zoom parameter to :class:~.ThreeDScene` (#1929)
* add a zoom parameter

* adding zoom trackers

* implementing zoom in three_d_scene

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updated typing error

* added test

* updated test

Co-authored-by: Iced-Tea3 <83535735+Iced-Tea3@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: KingWampy <9156604+WampyCakes@users.noreply.github.com>
2021-09-01 15:47:59 +02:00
Laith Bahodi
110d89f404
Use height to determine font_size instead of the _font_size attribute. (#1985)
* fix set_value and add some docs

* improve font_size property for tex/text_mobject.py

* add tests

* add more font_size tests

* round test_set_value_size)

* scale based on self._font_size

* add changing_font_size test

* rewrite test and add test i forgot to add

* improve hacky solution that didn't work

* add change font_size test for tex_mobject.py

* improve tests

* split into separate test

* remove component of old test

* fix docs

* simplify the setter
2021-08-31 22:44:25 +00:00
Laith Bahodi
223c2f86d0
Drop redundant OpenGL files and add metaclass support for Surface (#1843)
* replace old with new

* dropped redundant files

* replace examples in example_Scenes

* replace opengl_ in test

* ammend __init__

* opengl_compatibilty for Surface

* make resolution a tuple for opengl compat

* resolution changes in opengl.py

* rework sphere and enable dual renderer for 3d shapes

* adjust res for Torus

* actually drop file

* flip cairo_sphere resolution

* changes

* render each submobject individually

* make BraceLabel appear

* remove if config.renderer==opengl from mobject.py

* rewrite tests

* properly deprecate ParametricSurface

* revert rendering each submobject individually

* initialize OpenGLRenderer in Scene if config.renderer is opengl

* fix bases when config.renderer is changed

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* actually push test

* remove unused bounding_box + data from mobject.py

* overwrite tests

* use #1899 to switch renderer at runtime to make tests work

* attempt at fixing tests

* add renderer=cairo at the end of the test??

* rewrite failing test

* remove self.attr = self.attr for bracelabel

* remove accidental line in test

* remove unecessary bloat and make set_fill_by_value dual compatible

* update to remove deprecation warning

* add ParametricSurface to __all__

* deprecate ParametricSurface

* change some examples

* adjust docs

Co-authored-by: Darylgolden <darylgolden@gmail.com>

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Darylgolden <darylgolden@gmail.com>
2021-08-30 20:35:25 +00:00
Raj Dandekar
a558d3751f
Fix vector_to_coords() bug in :class:~.VectorScene. (#1871)
* Update vector_space_scene.py

* switch from attribute to method

Co-authored-by: Oliver <44864613+PhotonSpheres@users.noreply.github.com>

* add test

* remove debugger comment

Co-authored-by: Oliver <44864613+PhotonSpheres@users.noreply.github.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
Co-authored-by: hydrobeam <laithbahodi@gmail.com>
2021-08-30 20:28:47 +00:00
Laith Bahodi
d184d35b7b
Added examples, tests and improved documentation for coordinate_system.py. (#1941)
* add docs for get_x/y_axis_label and rename first parameter

* privatize methods that need to be private

* adjust docs for axis_labels and add buff parameter

* Add documentation and typing for ComplexPlane

* update point_to_coords docs

* add get_lines_to_point

* add example for coords_to_point

* add docs for get_line_to_point

* add example for get_vert/hori_line

* privatize create_label_tex

* add example for get_axis_labels

* add examples for get_x/y_axis_label

* add example for get_graph_label

* example for riemann rectangles

* add example for input_to_graph_point

* add example for get_area and add kwargs to method

* add doctests to slope_of_tangent + angle_of_tangent

* add example for get_secant_slope_group

* add example to get_vertical_lines_to_graph

* add Examples + touch ups

* add example and warning to get_graph

* pre-PR touchups

* revert accidental changes + fix docs error

* fix doctest

* fix doctest

* switch from dosctrings to code-blocks

* attempt at fixing obscure latex error

* Apply suggestions from code review

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* formatting and general cleanup

* two typos and minor improvement

* add non-graphical tests

* add graphical tests and control data

* fix tests

* more test errors

* add get_z_axis_label

* deprecate get_center_point

* missing return statement on log_func

* Apply suggestions from code review

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rewrite failing tests

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-08-30 20:21:58 +00:00
vinnniii15
4923086fc9
Fixed passing custom arrow shapes to :class:~.CurvedArrow (#1950)
* Update geometry.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added test for custom tip shapes for curved arrows

* added control data

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-08-30 21:42:14 +02:00
Laith Bahodi
f7ed88008b
Add font_size parameter for Tex and Text mobjects. (#1694)
* refactor numbers.py, numbers.py now uses font_size, adjust constants in tex_mobject.py and text_mobject, remove uses of number_scale_value in favour of font_size

* adjust PolarPlane to use font_size instead of scaling

* some of the docs have been changed to use font_size, adjust constant and add font_size to markup text

* accurate scale factors

* code mobject compatibility with font_size

* number_line now takes font_size

* make tests work

* cleanup

* deprecated test raised error, fixed

* typing for NumberLine

* fix misbehaving test

* actually fix set_value

* use native font_size scaling for text_mobject.py

* add constant and adjust BraceLabel

* fix change_label

* drop scale_factor for Title

* add some supers

* maybe fixes import issues

* numberplanetest

* the merge conflict is over and the tests run

* add test for tex_size

* some changes to the docs

* properly deprecate instead of removing

* move deprecations to __init__

* drop the config

* deprecate number_Scale_value

* update version number for deprecation

* adjust test precision

* if TYPE_CHECKING check

* adjust Using Text

* add font_size parameters for numberline and fix bug with decimal_number_config

* make set_value work with opengl

* make kwarg

* fix typo

* another typo

* change dates

* add font_size property for tex_mobjects

* _font_size instead of font_size (prep for prop)

* accidental bugfix, handle separately)

* generalize text2svg

* add font_size property for text_mobject.py

* add check for greater than 0

* Attribute error in dd_labels

* str for attr in hasattr

* rewrite and fix tests

* remove debugging print

* fix error when self.height ==0

* Apply suggestions from code review

Co-authored-by: Darylgolden <darylgolden@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert accidental @deprecated change

* fix error in line_spacing

* slight fixes

* use private attribute when checking for font_size in add_labels()

* raise a Value error when font_size < 0 + improve docs

* Apply suggestions from code review

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* deprecate azimuth_label_scale and use more descriptive deprecation message

* wrong number of dots for an import

* add font_size property for decimalmobject

* return to using public attribute

* remove redundant constant

* add comment

Co-authored-by: Darylgolden <darylgolden@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-08-26 20:16:55 -04:00
Václav Hlaváč
02446b3e7e
Fixed the positioning of line graph that was under the graph (#1951)
* removed a part of code that positioned a new line graph behind the axes

* added a line graph graphical unit test

Co-authored-by: Hugues Devimeux <36239975+huguesdevimeux@users.noreply.github.com>
2021-08-23 22:54:22 +00:00
sparshg
ec081d1ef5
Fixed :class:~.Rotate for angles that are multiples of :math:2\pi (#1938)
* custom path func for rotation anim

* small fix

* alt implementation

* small fixes

* tests
2021-08-21 15:00:53 +02:00
icedcoffeeee
fba4baef65
Made arrow tips rotate up/down (#1924)
* Made arrow tips rotate up/down

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rounding the doctest

* negative zeros

* Added notes on some calculations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Angled Tip test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Iced-Tea3 <83535735+Iced-Tea3@users.noreply.github.com>
2021-08-21 12:03:39 +02:00
Joy Bhalla
e4de8b728f
Reduced default resolution of :class:~.Dot3D (#1841)
* added parameter to reduce resolution of Dot3D

* modified dot3d class

* removed self from super().__init__ in class dot3d

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* regenerated control data for dot3d,tetra,octa,icosa,dodec

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Darylgolden <darylgolden@gmail.com>
2021-08-12 16:34:11 +08:00
Max Stoumen
fbc8c4a282
Fix test_opengl::test_Circle (#1894)
* fix(opengl): Reinstate test_Circle

* Re-render test data opengl/Circle.npz
2021-08-11 08:54:27 +02:00
Laith Bahodi
6eed276330
Removed :class:~.GraphScene, :class:~.NumberLineOld and parameters for :class:~.ChangingDecimal (#1860)
* remove NumberLineOld and GraphScene

* delete graphscene tests, shift plotfunctions test

* rewrite tests and fix __init__.py

* remove deprecation warning

* Update manim/animation/numbers.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
2021-08-04 01:04:18 -04:00
Laith Bahodi
3cd2a27780
Allow non-numerical values to be added to :class:~.NumberLine/:class:~.Axes (#1780)
* add add_labels for number_line

* fix bug in add_numbers

* change to self

* drop add_coordinate_labels

* add somed docs

* improve docs

* forgot :class:

* fix typing

* remove redundancies

* typing error

* dict --> Dict

* introduce scaling in `add_labels` 

quite annoying to manually adjust size (especially without `font_size`)

* added tests

* don't use Text in testing
2021-08-01 18:37:58 -04:00
KingWampy
3ac72fed0e
Rename Tabular to Table (#1851)
Co-authored-by: WampyCakes <WampyCakes@users.noreply.github.com>
2021-08-01 21:52:56 +02:00
Hugues Devimeux
b46b860e97
Converted all the graphical tests to the new syntax (Tests PR 3/3). (#1836)
* Added direct decoration support, and auto naming test.

* format

* Misclearnous fixes and improvements of the testing system

* Converted tests.

* Removed ununsed imports

* Added tolerance

* save frames as uint8

* regenerate control data

* migrate other tests that have been added in the meantime

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* try to make pre-commit happy

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-08-01 13:41:14 +02:00
Oliver
9db9f7c448
New Mobject: Added :class:~.Tabular (#1677)
* Init

* Added_lines

* stuff

* more stuff

* Added Examples

* black,isort,falke8

* Added to __init__

* Bugfix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added to reference.rst

* Added docstrings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added examples

* Added Docstrings and outer Lines

* Added Docstrings

* Added Docstrings and Examples

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Bugfix

* Removed Dummy-Mobject

* black/isort/flake8

* Special create function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Minor bugfix

* create() and docs

* Improved Docstrings

* Improved docstring

* -

* Bugfix in docs

* Added ability to grab specific elements

* Added ability to grab specific labels

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed f- string ValueError

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* bug-fix

* Improved Docstrings

* Added type hints

* bug fix

* improved typehints

* Improved Docstrings

* Added docstrings

* Added example for background

* Improved Docstrings and type hints

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* black

* Improved Docstrings

* bug fix

* codespell

* Highlight cells

* codespell

* Improved Examples

* Added graphical tests

* black/isort/flake8

* Changed test

* Testing the tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* minor changes

* minor changes

* opengl-compatibility

adjusted `OpenGLMobject`'s arrange in grid and added imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* get_highlighted_cell to add_highlighted_cell

* added test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed one test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Ideas from Hydrobeam

* Fixed Docstrings

* canged super()

* Private methods

* cleaned template, added test

* retrigger checks

* changed references.rst

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added to reference_index

* fixed test

* fixed tests

* Added docstrings

* Codespell

* spaces

* color and docs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* codespell

* add a config import

gonna do a few checks for renderer=opengl

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Hydrobeam suggestions

* Update manim/mobject/tabular.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* color to background

* typos

* added color parameter to method

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
2021-08-01 00:39:21 -04:00
Suhail Sherif
edd7b3423d
Fixed issues concerning frame_center in ThreeDScene (#1821)
* Putting frame_center in the center of the frame

* Update the scene whenever frame_center moves.

* Make the frame_center point invisible (no stroke).

* Extending the fix for #569 to 2 similar scenarios.

* Modified CameraMoveTest, fixes to 3d cam access

* Whoops, made a mistake with a partial add

* Added docstrings, type hints

* Apply suggestions from code review

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Implementing suggestions from code review.

* Performance improvement when frame center is stationary

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
2021-07-30 05:30:40 -04:00
sparshg
bc93a2e99a
DashedVMobject reworked (#1823)
* fix dashedVMobject

* add test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* also change opengl dashed vmobject

* fix dashedline

* small fix

* remove dash_spacing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* gitignore

* remove whitespace

* undo gitignore

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-07-29 16:27:53 +00:00
icedcoffeeee
266e54d3c5
Added a static method to :class:~.Circle to allow it to be defined by three points (#1765)
* Added new function: perpendicular bisector

returns two points that form the perpendicular bisector of the points given

* Circle mobject may accept three points.

If the radius not specified, the three points may be given to form the circle.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update geometry.py

* Added docs

* perpendicular bisector can work in 3D

* add test file

* add test scene

* Update manim/mobject/geometry.py

Co-authored-by: Darylgolden <darylgolden@gmail.com>

* changed the circle points test scene to addt

* Added docs for perp bisector function space ops

* typing error

* Made a static method for a circle from three points

* Added new test

Co-authored-by: Iced-Tea3 <83535735+Iced-Tea3@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Darylgolden <darylgolden@gmail.com>
2021-07-07 22:08:55 +08:00
Alex Lembcke
c79034ea29
Added .set_fill_by_value() to :class:~.ParametricSurface (#1686)
* Added color gradient by value to parametric surfaces

* Corrected example code for documentation

* Additional adjustments to example code

* Some more adjustments to example code

* Update manim/mobject/three_dimensions.py

I'm fine with this.

Co-authored-by: Hugues Devimeux <36239975+huguesdevimeux@users.noreply.github.com>

* Added example to :class:`~.NumberLine` (#1681)

* Update number_line.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/number_line.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/number_line.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/number_line.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update number_line.py

* Update manim/mobject/number_line.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update number_line.py

* Update manim/mobject/number_line.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Updated imports in `geometry.py` and added example to :class:`~.Arrow` (#1687)

* Updated imports in `geometry.py` and added example to :class:`~.Arrow`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update geometry.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Added example and parameter description to :class:`~.AnnularSector` (#1685)

* Added example and parameter description to :class:'AnnularSector'

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/geometry.py

Co-authored-by: Nikhil Garuda <34582615+Nikhil0504@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Nikhil Garuda <34582615+Nikhil0504@users.noreply.github.com>

* Update manim/mobject/geometry.py

Co-authored-by: Nikhil Garuda <34582615+Nikhil0504@users.noreply.github.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Nikhil Garuda <34582615+Nikhil0504@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Add a tutorial for using :class:`~.Text` and :class:`Tex` (#1510)

* Add a tutorial for using :class:`~.Text`

* Add gradient example

* Add disabling ligature tutorial
Move PangoMarkup to reference of MarkupText

* Add docs of using Colors, t2g and t2c
Also, fix issues issues between Color and Colour

* use save_last_frame whereever necessary

* More docs on Fonts, weights, slants

* fix docs built

* fix build

* typo

* fix build

* Try fixing the build

* Fix indent

* Fix indent

* Change class name

* Fix link

* Update examples

* Add small desc about MarkupText

* Basic LaTeX tutorials

* typo: seperately ==> separately

* add a missing `

* Update using_text.rst

* Update using_text.rst

* Update tex_mobject.py

* Update using_text.rst

* Update tex_mobject.py

* Update using_text.rst

* Update using_text.rst

* Apply suggestions from code review

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update docs/source/tutorials/using_text.rst

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* change title

* add ref to tutorial

* Fix small error

* Fix syntax

* Apply suggestions from code review (1st)

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Apply suggestions from code review

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update docs/source/tutorials/using_text.rst

* try to get link syntax right

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Added Example for :class:`~.CoordinateSystem` (#1690)

* Added Example for :class:`~.CoordinateSystem`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update coordinate_systems.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/coordinate_systems.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* remove accidental font_size

* maybe fixes doc error?

* \frac

* \over (??)

* double brace syntax 🤔

* explain syntax error and proper setting of label

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Rewrite stroke and fill shaders (#1716)

Rewrite vectorized mobject shaders to be compatible with transformation matrices.

* Added Example to :class:`~.PMobject` (#1698)

* Added Example to :class:`~.PMobject`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/types/point_cloud_mobject.py

Co-authored-by: Jan-Hendrik Müller <44469195+kolibril13@users.noreply.github.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jan-Hendrik Müller <44469195+kolibril13@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Exit gracefully if no scene was chosen (#1713)

* Exit gracefully if no scene was choosen

* Update module_ops.py

* Use logging system instead of print statement

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Update manim/utils/module_ops.py

Co-authored-by: Naveen M K <naveen521kk@gmail.com>

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Naveen M K <naveen@syrusdark.website>

* Fix bug when using Text with the opengl renderer. (#1729)

* the fix

* better fix

* OpenGL compatibility via metaclass: Matrix, DecimalNumber, Variable (#1585)

* OpenGL support

* remove opengl_value_tracker

* fix flake8

* switch to relative import

* Fix inheritence graph background color (#1734)

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* docs: remove reference of `--plugins` (#1732)

`--plugins` flag isn't implemented but it was mentioned in the
documentation. I have removed it.

* [pre-commit.ci] pre-commit autoupdate (#1691)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 21.5b2 → 21.6b0](https://github.com/psf/black/compare/21.5b2...21.6b0)
- [github.com/pycqa/isort: 5.8.0 → 5.9.1](https://github.com/pycqa/isort/compare/5.8.0...5.9.1)
- [github.com/codespell-project/codespell: v2.0.0 → v2.1.0](https://github.com/codespell-project/codespell/compare/v2.0.0...v2.1.0)

* fix typos

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* fix pillow to <8.3.0 (#1740)

* Metaclass compatibility for `coordinate_system.py`, `Code` and `ParametricSurface` (#1735)

* code metaclass

* axes metaclass

* make 3d axes and vmob work

* make code work (still bugged though)

* drop typo

* dropped period too, oops

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Added color gradient by value to parametric surfaces

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/three_dimensions.py

* Revert "Update manim/mobject/three_dimensions.py"

This reverts commit bccdc67980.

* already imported, not necessary to import again

Co-authored-by: Darylgolden <darylgolden@gmail.com>
Co-authored-by: Hugues Devimeux <36239975+huguesdevimeux@users.noreply.github.com>
Co-authored-by: MathInvariance <85428162+MathInvariance@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: Nikhil Garuda <34582615+Nikhil0504@users.noreply.github.com>
Co-authored-by: Naveen M K <naveen@syrusdark.website>
Co-authored-by: Devin Neal <devin@eulertour.com>
Co-authored-by: Jan-Hendrik Müller <44469195+kolibril13@users.noreply.github.com>
Co-authored-by: yit6 <70917928+yit6@users.noreply.github.com>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Mohammad Al-Fetyani <m4bh@hotmail.com>
2021-07-07 20:24:23 +08:00
Laith Bahodi
0561bebe76
Fixed accidental displacement in :class:~.Axes caused by include_numbers/numbers_to_include (#1664)
* the changes

* refactor a bit and change order of dict_merging so that it does not overwrite

* adjust test

* add docstring

* check against None

* implement the suggestion from comments + minor tweaking

* fix get_axis_labels

* adjust y_axis_label value slightly

* adjust test and refactor numberplane to remove redundant parameters

* better solution

* make .add_coordinates() file wide and nuke get_coordinate_labels

* code block

* drop uncessary assignmnets to the axes

* Apply suggestions from code review

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>

* include_tips --> tips in the docs

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>
2021-06-20 02:51:10 -04:00
Iced-Tea3
ed22296b04
Made the default arrowhead size for :class:~.Arrow3D smaller (#1693)
* Adjusted arrowhead size for Arrow3D

* Add files via upload

* Add files via upload

* Update three_dimensions.py

* Add files via upload

Co-authored-by: KingWampy <9156604+WampyCakes@users.noreply.github.com>
2021-06-17 12:35:52 -04:00
André
601d328799
Fixed error when processing SVG with omitted elliptical arc command (#1574)
* fixed arc implementation for omitted command

* added double elliptical arc test

* fixed incorrect startpoint when processing elliptical arcs

* added heart.svg test

* fixed elliptical arc processing error

* added elliptical arc test

* merging from elliptical_arc_fix
2021-05-31 13:15:10 +02:00
sparshg
272b0d521d
Fixed rotation of gradients while rotating a VMobject (#1513)
* Fixed rotation of gradients while rotating VMobject

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* use rotate_vector instead of rotation_matrix

* Add docs and type hints

* fix doc

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Anton Ballmaier <aballmaier@posteo.de>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-05-26 10:57:17 +02:00
Iced-Tea3
c9cdc96744
New feature: :class:ArcBrace (#1548)
* Added ArcBraceTest

* Update brace.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Cut the example scene

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed the scaling issue where the braces seemed too big

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated Test file for ArcBrace

* Fixed the braces being scaled too big for small arcs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add files via upload

* Update brace.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added warning

* Update brace.py

* Added mathem. explanation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated documentation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/svg/brace.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed a typo

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update brace.py

* Add typing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update brace.py

* Update brace.py

* Update brace.py

* Update brace.py

* Update brace.py

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* Update brace.py

* Update manim/mobject/svg/brace.py

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>

* ArcBraceTest Scene and lint

* Update test_brace.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jan-Hendrik Müller <44469195+kolibril13@users.noreply.github.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
2021-05-24 13:40:21 -04:00
friedkeenan
fb085d4693
Added :class:~.Polygram, rework the polygon inheritance tree, and add :class:~.Star (#1490)
* Add Polygram, reorder Polygon inheritance around it, add Star

* Add tests

* Spiff up tests and docs

* Avoid spaces allowing a newline in the middle of example coordinate

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix doctest

* Change Polygram.round_corners example

* Change StarExample to show how stars overlap with their regular polygram equivalent

* Apply suggestions from code review

Co-authored-by: Anton Ballmaier <aballmaier@posteo.de>

* Apply docs suggestions

* Change round_corners example to use a star

* Allow any iterable to be passed to Polygram

* Fix tests by converting all vertices to numpy arrays

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Anton Ballmaier <aballmaier@posteo.de>
2021-05-19 20:28:20 -05:00
Anton Ballmaier
567f0c6dc9
Color module enhancements (#1504)
* Clean up color definitions
 - Generate constants programatically from enum
 - Sort and structure colors in enum
 - Remove greys (with "e") from enum and only generate them as constants
 - Add gray_a alias lighter_gray
 - replaced screen_green with pure_green and added pure_red and pure_blue
 - Aliases now reference the same value instead of specifying it again
     (Example: gray = gray_c instead of gray = "#888888")

* add typing

* removed dark_blue and replaced blue_c by its value and add color overview example

* clean-up

* add flake8 comment

* Remove changed color

* update examples using BLUE_E

* restart CI

* add pure colors to example and update docs

* fix note

Co-authored-by: Jan-Hendrik Müller <44469195+kolibril13@users.noreply.github.com>
2021-05-15 13:03:54 +02:00
Newell Jensen
57a90b79be
Add SVG elliptical arc support (#1475)
* Add SVG elliptical arc support to svg_path.py

* Add SVG support for elliptical arcs

* Add debug fixes from Mark Miller.  Add sweep limit case for elliptical arcs that are multiple of 90 degrees.

* Add unit test for SVG elliptical arcs.  Add control data.

* Cast type of stroke_width if it is string.

* Fix black and isort.
2021-05-07 23:06:02 +05:30
Benjamin Hackl
40e427f053
Un-deprecated GraphScene (will be deprecated later), fixed an old-style call to NumberPlane (#1430)
* un-deprecate GraphScene

* x_range, y_range shouldn't be numpy arrays

* revert NumberPlane box and minor changes to other classes

* replace width in config with x_length

* fix docs

* fix tests

* remove failing test temporarily

Co-authored-by: hydrobeam <laithbahodi@gmail.com>
2021-05-01 16:22:24 +02:00
hydrobeam
9e88b64cd4
Upgrades to CoordinateSystem and graphing. (#1161)
* coordinate_systems.py

* number_line.py

* functions.py

* forgot to remove logging

* remove mutables in UnitInterval and restore things that shouldn't have been factored out

* visual changes + add backup in case only two args are given to x_range

* test_axes.py test reworked

* test_axes.py add tips

* coordinate_system + systems test and minor update to .py

* test_functions and mini-rework of funtions.py

* black and graph_scene test

* add defaults for threeDaxes

* all tests pass, threed updates

* make graphscene functional

* formatting

* test_axes_shift fix

* fix the broken test_axes_shift and docs

* forgot negative in docs

* missing commas

* fix broken example in graphscene.py

* forgot comma... again

* line_projection, import cleanup, and variable cleanup

* get_tick_range all numbers

* revert examples.rst

* restore GraphScene, deprecate it, introduce OldNumberLine

* rever test_axes_shift.py

* test_graphscene_reverted

* poetry error

* test_coord_system fix (?)

* unecssary import in graphscene

* black

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix tests (?)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add rounding for default coord_range + projection docs

* adjust test for rounding

* add zero fix

* used wrong fix

* set_length instead of rescale_to_fit

* fix improper coordinates for default NumberPlane

* update test

* adjust defaults for NumberLine and introduce dynamic scaling

* test adjusted

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* explanations + create axis docs

* parameters for NumberLine`

* NumberPlane documentation mods

* ThreeDAxes docs

* all done

* add colon for docs

* switch oldNUmberLine to NumberLineOld

* docs update for NumberLineOld

* Update manim/mobject/number_line.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/mobject/number_line.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/mobject/number_line.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* suggestions from code review

* missing period

* adjust wording for create_axis

* fix merge conflict (?)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-30 20:40:51 +02:00
Anton Ballmaier
03390f2751
Overhaul of the animation.indication module interfaces (#1383)
* test

* revert test changes

* Add Circumscribe, Deprecate others
Depreated:
   AnimationOnSurroundingRectangle
   ShowPassingFlashAround
   ShowCreationThenDestructionAround
   ShowCreationThenFadeAround

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add example and docs to Circumscribe

* Docs & Example FocusOn

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Docs & Example Indicate

* Fix Flash not using the given stroke_width

* Change the meaning of flash_radius to the inner radius

* Adjust flash_radius accordingly

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix runtime not working and add time_width to Flash

* finish Flash

* add second example to Flash

* Deprecate CircleIndicate

* Finish ShowPassingFlash

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Rework ApplyWave & Docs & Examples

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Finish Wiggle

* Fix docs inconsistancies

* black

* Add overview example

* fixe flake8 error

* Renew Test Data

* fix test scene

* try to fix test circumscribe problem

* tests behave weird...

* test without circumscribe

* add new test to circumscribe

* Explain wave code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed already done TODO

* Change circumscribe to require shape to be a type

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Restart CI

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-29 12:42:46 +02:00
Darylgolden
a43d7d3e75
Added :class:Polyhedron, and platonic solids :class:Tetrahedron, :class:Octahedron, :class:Icosahedron and :class:Dodecahedron (#1348)
* Rudimentary polyhedra class

* Move to own file + more polyhedra

* Icosahedron

* More polyhedra and renaming to singular form

* Changes

* Revert changes to graph

* Fix put_start_and_end_on and attempt to add updaters

* Update polyhedra.py

* Try to fix updaters

* Fix attempts

* more attempts

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* More attempts

* I got it to work

* side_length -> edge_length, start doc string

* More docs

* edge_length type hint and **kwargs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Docs title

* Config, docs

* Submobject docs

* Basic examples for the platonic solids

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Tests, black, rm personal test file

* Make pytest work properly

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix formatting

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Adding information about polyhedra

* Rm unused imports

* Actually finish the comment

* Apply suggestions from code review

Co-authored-by: Naveen M K <naveen@syrusdark.website>
Co-authored-by: kolibril13 <44469195+kolibril13@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Type hints for edge_length

* change faces_list type hint

* More typehints

* More typehints

* get_edges return type

* Type hint

* Replace Union[float, int] with float

* Fix typehints and attempt to fix tests

* Import dict from typehints

* Try to fix tests

* Fix typehint for mobject

* Conditional import and vgroup type hint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Import type_checking

* Retrigger

* Update manim/mobject/polyhedra.py

Co-authored-by: Naveen M K <naveen@syrusdark.website>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: kilacoda <65204531+kilacoda@users.noreply.github.com>
Co-authored-by: Naveen M K <naveen@syrusdark.website>
Co-authored-by: kolibril13 <44469195+kolibril13@users.noreply.github.com>
2021-04-29 10:51:18 +05:30
Darylgolden
a3faf1c9f1
Rewrite put_start_and_end_on to work in 3D (#1355)
* Use built in numpy functions and better angle_between_vectors

* Deleted angle_between since it duplicates the functionality of angle_between_vectors and isn't used anywhere

* Black

* Rewrite put_start_and_end_on to work in 3D

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix imports

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix tests

* Try to fix tests

* Update geometry.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix attempt

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Trying to fix AGAIN

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* evil hacking fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Retrigger checks

* Added test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Regenerate test data with Dot3D

* Readd angle_between

* Fix imports

* revert back to default vertex type for test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-23 14:13:14 +02:00
Darylgolden
ab1023b135
Added :meth:~.Mobject.match_points (#1364)
* Added become_points and become_style

* Retrigger checks

* Rename become_points to match_points

* Remove become_style

* rm test for become style

* Apply suggestions from code review

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>

* Try to fix docs

* Revert "Try to fix docs"

This reverts commit f72503ff72.

* Update manim/mobject/mobject.py

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
2021-04-19 14:57:35 -07:00
Newell Jensen
90a6aada40
Add SVG <line> element support to :class:~.SVGMobject (#1275)
* Add SVG <line> element support

* Add support for SVG <line> elements to SVGMobject

* Add unit test, unit test SVG file, and unit test data file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: Mark Miller <725mrm@gmail.com>
2021-04-09 14:53:07 -07:00
Benjamin Hackl
7b5d29e9b3
Fix random pipeline TeX failures (#1296)
* try to free us from curse of horse and cucumber

* adapt control data
2021-04-09 10:28:13 +02:00
Anton Ballmaier
cdaf5013f7
Change Brace from Tex to SVG (#1258) (#1260)
* test

* revert test changes

* Rework Brace to use SVG (#1258)

* change import order

* make import relative

* add graphics unit tests

* black tests

* Try to fix flake problem

Co-authored-by: kilacoda <65204531+kilacoda@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-09 02:31:06 +02:00
Adam Ryczkowski
3af4c867d1
Support for specifying the interpolation algorithms for individual ImageMobjects (#1122)
* Adds support for specifying the interpolation algorithms for individual ImageMobjects.

* Remove setup.py

* Added a proper unit test

* Code formatting

* Adds Doc string

* Test rewritten by  kolibril13

* Added control data to the test

* Replaces string resampling constants with Pillow integers; renames the constants into o 'resampling algorithms'

* Final 'nitpicks'

* ValueError update

* update example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: kolibril13 <44469195+kolibril13@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-04-08 16:09:09 +02:00
sparshg
08e06e156c
Render image automatically if no animation is played in a scene (#1261)
* Display image instead if attempting to make movie file with no animations

* update

* logging warnings added

* small fixes

* Fix broken test, add suggestions

* ignore skipping if scene finished

* fixes + replace self.play(Anim.. with self.add()

* dummy commit

* explicitly set write_to_movie in manim_directive

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-08 11:33:08 +02:00
Abhijith Muthyala
75fd9e2133
Set corners of :class:~.Rectangle in counterclockwise direction (#1249)
* Set corners of Rectangle in counterclockwise direction

* Update test data for RoundedRectangle

* Update test data for HomotopyTest

* Update test data for MoveAlongPathTest

* Update data for Cube related tests

* Fix failing doctest
2021-04-06 12:27:55 +02:00
Mark Miller
d8d9a01b9a
Enable CI testing for OpenGL (#1160)
* add simple circle test for opengl

* literally a comma

* add rgb tolerance to graphical unit tester

* start up xvfb on ubuntu?

* black style

* reduce tolerance to pixel ?

* add msys2 action

* add mesa install

* ci: windows add msys2 to path
Compile moderngl from source
add a init tests for CI to work
add colour to pytest

* minor edits

* mild refactor of scene / camera / renderer relationship

* flake-d

* reverted refactor

* reverted opengl split at the level of graphical unit tester

* remove unnecessary config in definition

* CI: remove python3 from MSYS2 also

Co-authored-by: Naveen M K <naveen@syrusdark.website>
2021-03-28 22:09:29 +02:00
Darylgolden
f98cb1eadc
Added 3D Mobject :class:~.Dot3D (#1097)
* Added Dot3D and SmallDot3D

* Remove wrong test data

* Revert changes to graphical units template

* Remove SmallDot3D per consensus

* Apply suggestions from code review

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Fix unclosed docstring

* Fix Dot3D

* Attempt to fix linting

* Revert "Attempt to fix linting"

This reverts commit 6c23d653b4.

* Retrigger checks

* Add example

* Update three_dimensions.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: WampyCakes <WampyCakes@users.noreply.github.com>
2021-03-27 02:06:33 +01:00
Kapil Sachdeva
c3f6119761
Added support for multiple transforms in the same SVG element (#1159)
* fix - in handle_transforms, add the support to parse multiple transforms from one attribute value

* further refactor the handle_transform; add a test svg with multiple transforms

* correction to the function doc regarding supported transforms

* fix the typo in the test name

* add tests for rotate, skewX & skewY transforms and emit a warning message that they are not supported yet

* add tests for translate, matrix and scale transforms / fix the handling of translate transform
2021-03-25 16:46:39 -07:00