Commit graph

39 commits

Author SHA1 Message Date
Darylgolden
6018ebf445 Revert "Merge branch 'main' of https://github.com/ManimCommunity/manim"
This reverts commit e7f9d23aa7, reversing
changes made to afe91d02b6.
2023-07-31 15:29:39 +08:00
Benjamin Hackl
1cd0f43982
Fixed expand animation for :class:.ManimBanner (#3298)
* fixed "a" appearing before shapes

* added animation test for ManimBanner

* added xelatex to linux pipeline

* xelatex -> xetex
2023-07-18 14:36:20 -07:00
Benjamin Hackl
a6651bee94
New tip shape :class:.StealthTip, allow specifying tip shape of :class:.NumberLine (#3201)
* added new tip class: StealthTip

* let NumberLine propagate tip_shape properly

* documentation, tests

* black

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

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

* fixed type hint, added some more documentation.

* black

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

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

* remove unused import

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-05 20:05:48 +02:00
Matthew Lee
117563e1f0
Added :meth:.set_opacity_by_tex method for setting the opacity of parts of Tex mobjects (#3159)
* Added MathTex.set_opacity_by_tex and MathTex.fade_all_but_tex

* Completed unittests for set_opacity_by_tex and fade_all_but_tex

* Added control_data for `fade_all_but_tex` and `set_opacity_by_tex`

* Removed ade_all_but_tex and integrated functionality into set_opacity_by_tex. Included a second parameter 'remaining_opacity' to define the opacity value of the remaining tex

* Added type hints for `set_opacity_by_tex`. Removed type information in docstring. Improved logic of `set_opacity_by_tex` to reduce redundant calls for tex parts

---------

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2023-03-29 08:33:13 +02:00
coreyp1
80795d8361
Added support for individualized radius values in :meth:.Polygram.round_corners (#3155)
* feat(Polygram.round_corners): add support for individualized radius values

* Update manim/mobject/geometry/polygram.py

Remove type hints from the docstring of round_corners()

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

* Update rounded_corners() so that integer values are accepted

---------

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2023-03-28 22:13:12 +02:00
Kevin Lubick
b54743e81d
Add scene.replace() and use in ReplacementTransform (#3042)
* Add scene.replace() and use in ReplacementTransform

This replace method allows one mobject to take the place (that is,
the draw order) of another mobject.

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

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

* Address Feedback

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

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

* Update visual Replacement test and fix extract_frames.py

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

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

* allow flake8 to be unhappy

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>
2023-01-27 12:23:33 +01:00
Benjamin Hackl
ab57a6eb35
Frame comparison pixel threshold (#3053)
* implemented threshold for number of pixel value errors

* fix implementation, throw proper warning

* added test for pixel value error threshold

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

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

* remove forgotten debug print

* introduce constants for frame_comparison tolerance

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

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

* rename constant

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-01 17:38:44 +00:00
Alexander Vázquez
388504307a
Implemented :class:.LineJointTypes for both Cairo and OpenGL renderer (#3016)
* LineJoins added

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

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

* added joint type enum, refactored proposed implementation

* added test for joint types

* added documentation

* let LineJointType.AUTO be rendered like before

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

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

* update added example in basic.py to reflect changed implementation

* fix RTD build

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

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

* moved rendered example in documentation

* [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>
2022-11-13 16:14:55 -07:00
Benjamin Hackl
93f916587b
Fixed rendering SVG paths with multiple move commands (#3019)
* implement missing VMobject.resize_points

* ensure that VMobject.start_new_path *actually* starts a new path

* add missing imports

* doctest resize_array

* added test with weird dvisvgm generated svg

* black

* [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: Naveen M K <naveen521kk@gmail.com>
2022-11-13 06:24:45 +00:00
Duc Phat
5ca1763068
fix: Align lines correctly when passing faded_line_ratio property to NumberPlane (#2894) (#2920)
* fix: Align lines correctly when passing `faded_line_ratio` property to NumberPlane (#2894)

* regenerated test data

* removed unnecessary check for empty input

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-11-05 12:18:11 +00:00
Benjamin Hackl
b3b90ef346
Rewrote unstable tests for :mod:.text_mobject to be non-graphical (#2982)
* removed text test control data

* rewrote text tests to be non-graphical

* [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>
2022-10-26 19:52:08 +02:00
Benjamin Hackl
309c9d41eb
Ported improved implementation of :class:.SVGMobject from 3b1b/manim (#2898)
* port SVGMobject from 3b1b/manim

* added svgelements as dependency

* revert change of default values

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

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

* set default stroke_width of svg elements to 0 if not set

* fix handling of circles with different rx/ry

* turn more methods into staticmethods

* removed duplicated method

* set/adapt stroke-width of some test SVGs

* updated control data

* forgot some control data

* fixed init_colors in tex_mobject and text_mobject

* minor changes, added docstrings

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

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

* module docstring, removed import

* vector_to_coords changed again

* nail sphinx version to below 5.1 to fix rtd (?)

* update test_text control data for science

* changed Brace to use VMobjectFromSVGPath

* remove unused classes and methods depending on old SVG path implementation

* remove style_utils and svg_path modules

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

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

* change test_text to use monospace font

* restore geometry.polygram

* added get_mobject_type_class auxiliary method; changed polyline implementation to ad-hoc approach

* restore test_text to previous version

* skip Use tags as svgelements already populates them

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-28 18:02:53 +02:00
Kevin Lubick
c4f1d202a9
Prevent TransformMatchingTex from crashing when there is nothing to fade (#2846)
* Prevent TransformMatchingTex from crashing when there is nothing to fade

Fixes #2845 and adds tests.

I originally tried to make FadeTransformPieces not crash if it was given two Mobjects with no submobjects, but I couldn't quite get that to work. This is probably the less invasive of a change.

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

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

* use Tex arrows

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

* Update expectations after Tex change

* Address feedback

This makes FadeTransform::ghost_to more robust to receiving an empty target. It is currently unspecified what should happen, so how about just fading in place?

* [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>
2022-09-24 16:22:42 +02:00
Benjamin Hackl
ce9acddd41
Improved performance of `test_threed.py` (#2893)
* lower resolution of surfaces in 3D tests to greatly improve performance

* regenerated test data

* print test execution time by default
2022-07-22 14:21:03 +00:00
Alex Lembcke
4f42ad5664
Enabled filling color by value for :class:.OpenGLSurface, replaced `colors keyword argument of :meth:.Surface.set_fill_by_value with colorscale` (#2186)
* Enable filling color by value for OpenGLSurface.

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

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

* Added doc string and removed unused deprecated_params

* Added docstring and made method private.

* Fixed spelling error.

* Update manim/mobject/types/opengl_surface.py

Agreed.

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

* Fixed typings

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

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

* Added None type as part of color checking

* Another attempt at fixing the color typings

* Made some of the requested modifications.

* Fixed failing tests.

* Added tests for Cairo method.

* One minor change to test plot_surface.

* Fixed typo in docstring.

* Removed passing in of axes.

* Removed axes in tests.

* Fixed typo, mixed up u and v.

* Fixed docstring typo, updated format to recommended.

* Fixed one more typo in docstring.

* One last time editing the docstring.

* Add deprecation import to opengl_surface.

* Added import for Surface and OpenGLSurface to coordinate_systems.

* Hoping this fixes the example for the docs.

* Addes colorscale_axis to plot_surface

* Forgot to update the docstring.

* added proper deprecation, made change temporarily backwards compatible

* [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>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
2022-07-13 18:44:12 +02:00
Sparsh Goenka
6c58f4a777
Added :class:.ChangeSpeed, an animation wrapper that allows to smoothly change the speed at which an animation is played (#2749)
* Added speedmodifier.py

* fix bugs, stable state

* rate_func, comments

* Add docs

* add `ChangedWait`

* run_time override for AnimationGroup

* fix AnimationGroup

* change example

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

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

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

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

* fix docstrings

* small improvements

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

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

fix AnimationGroup

fix AnimationGroup...

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

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

* add_updater for changed speed

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

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

* rename vars

* Remove `ChangedWait`,
Set default `rate_func` for `Wait` to `linear`

* fix `Succession`

* fix updaters

* fix docs

* rename vars

* [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>

* convert lambdas into funcs

* Add tests.

* reduced test run time and regenerated control data

* Update manim/animation/speedmodifier.py

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

* include new module in docbuild

* added module docstring

* fixed non-rendering examples in documentation

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>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
Co-authored-by: Benjamin Hackl <benjamin.hackl@aau.at>
2022-07-06 16:39:55 +02:00
Tristan Schulz
9359331eff
Add vectorized plotting functionality to improve performance (#2739)
* enhancement(ParametricFunction, CoordinateSystem, Axes, NumberLine): vectorized coords_to_points,plot,plot_parametric_function; added Numberline:number_to_point_array

* test(plot_log_x_axis_vectorized): added test for vectorized plotting

* extend(angle_of_vector): added test for angle_of_vector with ndarray as input

* fix(frames_comparison): fix naming of test data to be able to write and read the file name because ':' is forbidden

* test(plot): add more vectorized tests, added use_vectorized fixture to make life simpler

* fix(coordinate_system,number_line,scale): vectorizing functions and fixing bugs

* enhancement(NumberLine): vectorized number_to_point and added test

* enhancement(NumberLine): added tests for point_to_number, added example to doc

* enhancement(CoordinateSystem): added test for coords_to_point_vectorized and vectorized coords_to_point

* enhancement(Axes): vectorized point_to_coords and added tests

* Minor formatting fixes and doctests

* fixed flake hint with generator expression

* Create __init__.py

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

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

* Update documentation for antiderivative

* Update manim/mobject/graphing/coordinate_systems.py

Co-authored-by: Raghav Goel <raghavgd2h@gmail.com>

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

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

* Update manim/mobject/graphing/coordinate_systems.py

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

* Update manim/mobject/graphing/coordinate_systems.py

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

* Update manim/mobject/graphing/functions.py

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

* Update manim/mobject/graphing/coordinate_systems.py

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

* Update manim/mobject/graphing/coordinate_systems.py

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

* fixed wrong indentation

* stop doctest from leaking change in global config

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

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

* change code block type

* [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: Raghav Goel <raghavgd2h@gmail.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-06-19 18:10:34 +02:00
Simeon Widdis
3ae46a4c13
Fix TransformMatchingAbstractBase Mobject leaks (#2826)
* Clean up ghost Mobject in TransformMatchingAbstractBase

TransformMatchingAbstractBase does Fade transitions when no mismatch handling is defined, the current implementation leaves an invisible object behind when it's applied. This commit adds handling to clean it up.

Co-Authored-By: Andrew Yang <4412798+AndrewYY@users.noreply.github.com>

* Add tests for TransformMatching default mismatch behavior

* Document new interpolation behavior

* Add TransformMatching code review changes

* Revert "Add TransformMatching code review changes"

This reverts commit 6de61ecbba.

* Revert "Revert "Add TransformMatching code review changes""

Mistakes were made, we need to revert deeper.

This reverts commit 7bd9f4ebea.

Co-authored-by: Andrew Yang <4412798+AndrewYY@users.noreply.github.com>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
2022-06-19 10:39:54 +02:00
Simeon Widdis
bcb5233259
Add documentation and testing for Transform's path_func behavior (#2771)
* Add graphical tests for Transform with paths

* Rewrite path function setting in Transform

Currently setting the path function in Transform is done unintuitively,
this commit reorders the path_func assignment to make it more clear what
it's doing.

Passes 609 tests / Skips 12 tests

* Add Parameter DocString to Transform class

* Add Transform test for conflicting path settings

* Apply suggestions from code review

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

* Update manim/animation/transform.py

Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
2022-06-19 01:56:15 +02:00
WillSoltas
ce4ac5162b
Added Axes Tip Resize Functionality according to Axes documentation (#2661)
* Added Axes Tip Resize Functionality according to Axes class documentation

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

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

* Changed Default Tip Size Values to Conform with Global Defaults

* Fixed width kwarg usage on circle/square tips

* Fixed ratio-impacted default tip width for vectors

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

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

* Removed Left-over Prints :)

Co-authored-by: Will Soltas <willsoltas@Wills-MacBook-Pro-2.local>
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>
2022-05-09 19:40:19 +00:00
niklebedenko
cfd006aa7f
Matrix brackets (#2709)
* Fixed bracket warping for matrices

* fixed bodge for bracket splitting

* changed default value, removed old import

* updated VectorScene test

Co-authored-by: niklebedenko <nananananabatman>
2022-05-09 19:37:40 +00:00
Jonathan Alpert
bef8302be3
Created a more accessible way to create Angles with line.py angle function - Angle.from_three_points (#2684)
* fixed style

* fixed style

* fixed formatting

* Update manim/mobject/geometry/line.py

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

* Update manim/mobject/geometry/line.py

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

* Update manim/mobject/geometry/line.py

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

* Update manim/mobject/geometry/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

* fixed formatting comments and added tests that can visualize graphic better

* Update manim/mobject/geometry/line.py

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

* Update manim/mobject/geometry/line.py

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

* added additional example

* Update manim/mobject/geometry/line.py

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

* Update manim/mobject/geometry/line.py

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

* example has been changed!

* fixed name change

* reverted change to not include Vgroup

Co-authored-by: hickmott99 <71236306+hickmott99@users.noreply.github.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>
2022-04-23 11:15:14 +08:00
sparshg
7f464cc5d3
Fix background lines drawn twice in NumberPlane (#2634)
* fix axis lines drawn twice in numberplane

* simplified and fixed test, added comments

* fixed background lines drawn when both x_min, x_max are negative

* regenerated control data of failing tests

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

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

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>
2022-04-15 22:12:44 +00:00
darkways
5071e9418b
Fix Bug Uncreate() with rate_func via introducing new parameter reversed to class Animation (#2597)
* `Uncreate()` works with `rate_func` ,fix #2469

Place the reverse of `rate_func` to become part of the process in `Uncreate()`.

The original `uncreate()` is implemented by setting a specific value to `rate_func`.

Now, if you want to set parameter`rate_func` when using `Uncreate()`, you can set the parameter `reverse_rate_func` to `Uncreate()`.

Examples

```python
.. manim:: ShowUncreate

        class ShowUncreate(Scene):
            def construct(self):
                self.play(Uncreate(Square(), reverse_rate_func=linear))
```

But problems remains when you try to pass parameter `rate_func` to `Scene.play()`

* fix issue #2469

* Add parameter reversed to class Animation

Fix an error in the last [commit](47b5196e3f). The "remover" decided whether it would reverse. Now it correctly passes the power of decision to "reversed".
Add a bool parameter `reversed` to class `Animation`. It decides whether the animation need to be played backwards. Default to be False.

* Add unit tests for usages of `Uncreate()`

* Add control data for the new unit test

* change the implementation of `Unwrite` to the same logic as `Uncreate`

* Rename parameter `reversed`, add descriptions, style #2597

Rename `reversed` to the more explicit `reverse_rate_function`, in class Animation.
Explicitly mention in documentation that setting `reverse_rate_function` doesn't have any effect on `remover` and `introducer`.

* improve documentation of parameter `reverse_rate_function`, doc #2597

improve documentation of parameter `reverse_rate_function` in class `Animation`

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

* doc: remove unnecessary comments in creation.py

The comment was added because the name of the parameter `reversed` was similar to reverse, which is a also parameter, but defined in Write().
Now the parameter has a more explicit name `reverse_rate_function`. Developers can get the main idea from its name. So we don't need the comment to tell.

Co-authored-by: Sefik-Palazoglu <sefik.palazoglu.s@gmail.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-04-09 09:49:16 +00:00
Benjamin Hackl
294efcd651
Fixed render flow issues with introducer animations (#2594)
* only let introducer add mobject if not yet present

* fix check for empty moving_mobjects list

* added two tests

* added control data

* black

* fixed usage of Mock in some tests

* check family members instead of mobject list

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

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

* moved moving_mobjects / static_mobjects assignment to begin_animations

* restored correct render flow, made sure static_image is created properly

* fixed some tests

* make sure scene_finished handles frame update correctly

* improve / fix test_vector_scene

* black

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-03-08 20:25:04 +00:00
ad_chaos
db504a548b
Fixed bug with invalid color type `None` (#2584)
* Add test

* Seperate test

* Better solution

* Rebasing is hard

* revert changes to get_style

* handle color lists containing None properly

* added test for match_style with gradient

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

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

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>
2022-03-06 19:30:02 +01:00
Laith Bahodi
2275ec5916
:class:~.MathTex, :class:~.Tex, :class:~.Text and :class:~.MarkupText inherit color from their parent mobjects. (#2467)
* comment out color-related things from tex_mob

* add change to svg_mobject

* MarkupText handles colour internally

* MarkupText handles colour internally

* make coordinate_system.py colour agnostic

* get_line_from_axis_to_point

* add typings for SingleStringMathTex

* add typings for MathTex

* make internal methods internal

* black + isort

* fix typo

* black + isort

* fix typo

* revert internalizing change

* Revert "Merge branch 'mathtexx' of https://github.com/hydrobeam/manim into mathtexx"

This reverts commit 6be3c39814, reversing
changes made to 2b30b446ae.

* remove accidental import

* do it in a less bad way

* WIP: Text2setting causing problems

* allow tex_mobject.py to inherit colour

* allow tex_mobject.py to inherit colour

* add tests

* remove undeedde imports + formatting

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

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

* fix warnings from pre-commit hooks

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

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

* fix some tests

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

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

* remove other color_inheritance test

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

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

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

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

* fix typo

* accomodate the color->attribute PR

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

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

* Fix tests and doc build

add a check for None when inheriting colour in
`coordinate_systems.py`, and turn written tests
into graphical tests

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

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

* Comment out `Text` color inheritance test.

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

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

* Set font for text_color_inheritance test

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

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

* Small change to retrigger docs build

* [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>
2022-02-19 19:57:19 +01:00
Simon Ellmann
ac1ee9a683
Fix axes plotting bug with logarithmic x-axis (#2548)
* Fix axes plotting bug with logarithmic x-axis

The scaling function was not applied to the last x-value to be evaluated,
resulting in a wrong point of the function plot and a weird line from
the second-last to the last point when using a scaled x-axis.

* Add graphical unit test

Co-authored-by: icedcoffeeee <83535735+icedcoffeeee@users.noreply.github.com>
2022-02-16 11:55:59 +01:00
icedcoffeeee
a6c4ee4d1a
Added OpenGL compatibility to ThreeDScene.add_fixed_orientation_mobjects and ThreeDScene.add_fixed_in_frame_mobjects (#2158)
* made add_fixed_orientation_mobjects to be opengl compatible

* made add_fixed_in_frame_mobjectsto be opengl compatible

* implemented uniform attribute 'is_fixed_orientation'

* updated shader files

* remove previous implementation

* update

* update

* added tests

* rename mob_center to fixed_orientation_center

* Update frame_server_impl.py
2022-02-12 09:47:40 +01:00
icedcoffeeee
280854e928
Reworked space_ops.py (#2524)
* first rework

* use rotvec and updated transpose rot mat

* shortcut for about z_axis

* rework get_unit_normal

* rewrite center_of_mass

* rewrite find_intersection

* shoelace using trapz

* use external quaternion package

* Correct error message

Co-authored-by: Kiran-Raj-Dev <90276965+Kiran-Raj-Dev@users.noreply.github.com>

* correct the tests

No major change, just tiny differences due to floating point error

* new test

* Update test_space_ops.py

* Revert "use external quaternion package"

This reverts commit 1fc318ca60.

* Update space_ops.py

* updated tests

* updated tests and error message

* Technically called segments

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

* minor changes in wording regarding intersection (lines vs line segments)

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

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

Co-authored-by: Kiran-Raj-Dev <90276965+Kiran-Raj-Dev@users.noreply.github.com>
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>
2022-02-06 13:08:50 +00:00
鹤翔万里
099e4eed0c
Fixed two issues of :class:~.SVGMobject (#2490)
* fix issue of nested svg

* fix issue of the order of transforms

* fix bug of node which is not an element

* fix x y property in SVGMobject._handle_transforms

* adapted control data

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-01-25 14:48:43 +00:00
Marcin Serwin
a96ad3e822
Fixed animations introducing or removing objects (#2396)
* Replace finish with clean_up_from_scene in ShowPassingFlash

* Add introducer flag to animations

* Mark some animations as introducers

* Handle animating graph

* Update tests

* Update tests to provide mocked scene

* Make setup_scene internal

* Replace string annotation with new typehints

* [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: Darylgolden <darylgolden@gmail.com>
2022-01-23 09:56:44 +08:00
Laith Bahodi
149479f913
Refactored :class:~.BarChart and made it inherit from :class:~.Axes. (#2387)
* rebase

* fixed None bar_names

* fixed scale issues

* fixed to accept negative bar values

* fixed some bugs

* Added docs for parameters (DRAFT)

* clean up parameters

* more clean up

* clean up __init__

* replace add_x_labels with built-in functionality

* adjust default font_size for labels

* Update docs descriptions

* Add bar_width and adjust get_bar_labels

* Add bar_width and adjust get_bar_labels

* Add docs to class and methods

* remove unecessary imports

* remove getters

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

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

* Attempt to fix duplicated parameters section

* adjust BarChart example to include title

* switch order around

* change_bar_values

* back to get_bar_values

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

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

* add docs for _update_default_config and fix method

* remove print(dicts)

* allow negative_numbers to work with bar chart

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

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

* allow negative numbers to work with change_bar_values

* add test_probability.py

* add control data

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

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

* change example

* update examples again

* rewrite test

* rewrite other test

* remove comma after list in example

* improve wording in docs

* add parameter/docs for label_constructor

* change create_label_tex and update methods

* update docs

* use decimal number

* switch default to Tex

* update instances of create_label_tex in coordinate_systems.py

* hardcode for add_labels

* add TODO

* use label_constructor

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

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

* fix indentation in docs

* Fix minor doc typo

Co-authored-by: Led Me Explain <ledmeexplain@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-16 09:05:50 -05:00
Marcin Serwin
540dc70d2f
Update Text to use new ManimPango color setting (#2341)
* Find indexes in stripped text, not original text

* Add regression test

* Only run the test in linux environement

* Rewrite text2settings in Text to set text color via pango

* Make gradient in Text use pango coloring

* Bump manimpango to newest version

* Update test to use new frames_comparison

* Don't remove svg file on exception

* Bump manimpango

* Fix pre-commit errors

* Fix index bug

* Deprecate no longer used functions set_color_by_t2x

* Remove old commented out code

* Update poetry.lock
2022-01-03 18:46:04 +05:30
Leo Xu
b91c6fd50d
Made set_fill_by_value() support gradients on different axes. (#2383)
* Made set_fill_by_value() support gradients on different axes.

* Removed extra tests and made default for set_fill_by_value to the z-axis.

* Fixed test in test_threed.

* Changed the the set_fill_by_value() test in test_threed.py.

* Fixed set_fill_by_value() documentation

* removed duplicated entries in .gitignore

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-12-31 01:56:14 +01:00
Jihoon
b6f7acf0e1
Added `about_point keyword argument to :class:~.ApplyMatrix` (#2388)
* Added `about_point` for :class:`~ApplyMatrix`

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

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

* Add unit test

* Fix test

* remove unit_test because transform does not update points

* minor docstring formatting changes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laith Bahodi <laithbahodi@gmail.com>
Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-12-31 00:14:52 +00:00
Gergely Bencsik
e61d22fdfe
Improved DashedVMobject (#2372)
* Added even_lengths option to DashedVMobject and updated example

* Added dash offset parameter to DashedVMobject

* Stupid bugfix for np.append()

* tried to update DashedVMobject control data

* modified geomtery test to use new feature and updated control data

* Update manim/mobject/types/vectorized_mobject.py

doc string improvement

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

* Update manim/mobject/types/vectorized_mobject.py

Small restructure around dash-overflow handling

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

* i don't know what im gitting but something with vmobjects

* renamed even_lengths to equal_lengths

* fixed equal_lengths renaming in Example

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-12-19 14:10:10 +01:00
icedcoffeeee
8194078657
Implemented :meth:.CoordinateSystem.plot_antiderivative_graph (#2267)
* implement antiderivative

* docs

* tests

* typo

* more documentation

* Revert "more documentation"

This reverts commit 327e4adca1.

* more documentation

* optimized antideriv function

* added parameters

* tests

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-12-04 10:52:55 +01:00
Benjamin Hackl
044dcad53f
Made frames_comparsion testing utility a proper module of the library (#2346)
* make frame_comparison a part of the library

* update frames_comparison imports; move control data

* change import in documentation

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

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

* properly split up boolean_ops tests

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

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

* added __init__ to utils.testing

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-03 21:18:18 +01:00