manim | Animation engine for explanatory math videos | Animation library

 by   3b1b Python Version: v1.6.1 License: MIT

kandi X-RAY | manim Summary

kandi X-RAY | manim Summary

manim is a Python library typically used in User Interface, Animation applications. manim has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can install using 'pip install manim' or download it from GitHub, PyPI.

Manim is an engine for precise programmatic animations, designed for creating explanatory math videos. Note, there are two versions of manim. This repository began as a personal project by the author of 3Blue1Brown for the purpose of animating those videos, with video-specific code available here. In 2020 a group of developers forked it into what is now the community edition, with a goal of being more stable, better tested, quicker to respond to community contributions, and all around friendlier to get started with. See this page for more details.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              manim has a highly active ecosystem.
              It has 51787 star(s) with 5318 fork(s). There are 858 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 362 open issues and 704 have been closed. On average issues are closed in 108 days. There are 10 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of manim is v1.6.1

            kandi-Quality Quality

              manim has 0 bugs and 0 code smells.

            kandi-Security Security

              manim has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              manim code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              manim is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              manim releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              It has 16789 lines of code, 1734 functions and 101 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed manim and discovered the below as its top functions. This is intended to give you an instant insight into manim implemented functionality, and help decide if they suit your requirements.
            • Visualize the function graph .
            • Parse command line arguments .
            • Initialize the configuration .
            • Get configuration .
            • Return a section of the slope segment
            • Calculate the earclip of a triangle .
            • Compute the cubic approximation of the cubic approximation .
            • Updates the shadow cloud
            • Generate a list of animation instances from play_args .
            • Modify special characters .
            Get all kandi verified functions for this library.

            manim Key Features

            No Key Features are available at this moment for manim.

            manim Examples and Code Snippets

            Frame and pixel shape
            Pythondot img1Lines of Code : 0dot img1License : Permissive (MIT)
            copy iconCopy
            ASPECT_RATIO = 16.0 / 9.0
            FRAME_HEIGHT = 8.0
            FRAME_WIDTH = FRAME_HEIGHT * ASPECT_RATIO
            FRAME_Y_RADIUS = FRAME_HEIGHT / 2
            FRAME_X_RADIUS = FRAME_WIDTH / 2
            DEFAULT_PIXEL_HEIGHT = 1080
            DEFAULT_PIXEL_WIDTH = 1920
            DEFAULT_FPS = 30  
            Buffs
            Pythondot img2Lines of Code : 0dot img2License : Permissive (MIT)
            copy iconCopy
            SMALL_BUFF = 0.1
            MED_SMALL_BUFF = 0.25
            MED_LARGE_BUFF = 0.5
            LARGE_BUFF = 1
            DEFAULT_MOBJECT_TO_EDGE_BUFFER = MED_LARGE_BUFF    # Distance between object and edge
            DEFAULT_MOBJECT_TO_MOBJECT_BUFFER = MED_SMALL_BUFF # Distance between objects  
            Run times
            Pythondot img3Lines of Code : 0dot img3License : Permissive (MIT)
            copy iconCopy
            DEFAULT_POINTWISE_FUNCTION_RUN_TIME = 3.0
            DEFAULT_WAIT_TIME = 1.0  
            manim - manim example ext
            Pythondot img4Lines of Code : 55dot img4License : Permissive (MIT License)
            copy iconCopy
            from docutils import nodes
            from docutils.parsers.rst import directives, Directive
            
            import jinja2
            import os
            
            
            class skip_manim_node(nodes.Admonition, nodes.Element):
                pass
            
            
            def visit(self, node, name=""):
                self.visit_admonition(node, name)
            
            
            de  
            manim - example
            Pythondot img5Lines of Code : 27dot img5License : Permissive (MIT License)
            copy iconCopy
            from manimlib import *
            
            class SquareToCircle(Scene):
                def construct(self):
                    circle = Circle()
                    circle.set_fill(BLUE, opacity=0.5)
                    circle.set_stroke(BLUE_E, width=4)
                    square = Square()
            
                    self.play(ShowCreation(sq  
            Manim MathTex - Multiple text fragments in numerator of fraction
            Pythondot img6Lines of Code : 6dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            text = MathTex(r"\frac{a}{b}", font_size=24)
            self.add(index_labels(text[0]))
            text[0][0:1].set_color(YELLOW)
            text[0][1:2].set_color(RED)
            self.add(text)
            
            copy iconCopy
            apt-get install sox ffmpeg libcairo2 libcairo2-dev
            apt-get install texlive-full
            pip3 install manimlib  # or pip install manimlib
            
            pip3 install manimce  # or pip install manimce
            
            How to properly import a Python package in PyCharm?
            Pythondot img8Lines of Code : 2dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            from manimlib.mobject import geometry.Polygon as Polygon, svg.text_mobject.Text as Text
            
            How can I play an animation from a non-Scene class using manim?
            Pythondot img9Lines of Code : 10dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            class MainScene(Scene):
                def construct(self):
                    ...
                    neurons = NeuralNetworkMobject()
                    your_animation_function(neurons)
            
                def your_animation_function(self, neurons):
                    self.play(FadeIn(neurons))
                    ...
            
            Manim Display Latex Table
            Pythondot img10Lines of Code : 52dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            class Table1(Scene):
                def construct(self):
                    table = r"""
                    \begin{table}[]
                    \centering
                    \begin{tabular}{|l|l|l|l|l|}\hline
                    &  & \multicolumn{2}{l}{End} &  \\\hline
                    Top &  & 

            Community Discussions

            QUESTION

            Manim MathTex - Multiple text fragments in numerator of fraction
            Asked 2022-Mar-17 at 19:36

            I am working on a Manim project where I am manipulating equations algebraically. This is made easy using many of the provided utilities, but in order to do so smoothly I must separate MathTex objects into multiple isolated "fragments". This can be done in many ways, but I have opted to use the double brace syntax:

            ...

            ANSWER

            Answered 2022-Mar-13 at 22:53

            The Manim CE examples also mention another method for complex strings when isolating sub-strings do not work. It involves considering manual indices of the individual substrings and setting the colour on the substring indices directly.

            So, for the Tex code \frac{a}{b}, it would probably look a bit like this:

            Source https://stackoverflow.com/questions/70175366

            QUESTION

            how can I rotate line with only changing theta?
            Asked 2022-Mar-12 at 08:47

            I was making animation with manim and I tried to make line that one end is fixed, and one end moves along the arc. The way I wanted to solve this problem was to define each point with theta, and let the point move along the arc as it moves. However, even if the setta was changed, the line did not move, so the rotate was used, but the length of the line did not change, so the line deviated from the arc and failed. I wonder how to make the line move smoothly with the size of the angle when theta value is changed to an arbitrary value with theta as a parameter.

            ...

            ANSWER

            Answered 2022-Mar-12 at 08:47

            Your mobjects do not change because the dependency on Theta is not retained after initializing the mobject -- but it doesn't take too much to make it work!

            The solution to your Problem is using a ValueTracker for the value of theta (to easily allow animating changing it) and updater functions for the mobjects you would like to change. In other words:

            Source https://stackoverflow.com/questions/71446900

            QUESTION

            manim camera.move_to and camera.scale at the same time don't work
            Asked 2022-Feb-26 at 21:41

            Here is a sample code:

            ...

            ANSWER

            Answered 2022-Feb-26 at 21:41

            Manim doesn't handle simultaneous animations called on the same mobject in that manner. Instead, you can actually chain animations with the .animate syntax to get the effect you want. So:

            Source https://stackoverflow.com/questions/71280144

            QUESTION

            manim set_z_index with value_tracker
            Asked 2022-Feb-15 at 20:57

            The value_tracker seems to not take into account the z.index for a small amount of time at the end when changing its values and I don't really understand why. I've deliberately added lots of set_z_index(1) to try and solve it but nothing did. Here is a sort of minimalist example of the problem:

            ...

            ANSWER

            Answered 2022-Feb-15 at 20:57

            AnimationGroup does some very weird things from time to time. In this particular instance, it messes with the rendered mobject order (which is a particularly common side effect, unfortunately). If you don't absolutely have to use it, avoid it.

            In this case, you can simply change your play call to

            Source https://stackoverflow.com/questions/71133158

            QUESTION

            Debug Manim community in PyCharm
            Asked 2022-Feb-14 at 13:31

            Is there any way to debug a Manim community python script within PyCharm?

            I found this discussion for Manim 3b1b version but it doesn't apply to Manim community and I prefer to use the community version as it seems to be better documented.

            ...

            ANSWER

            Answered 2022-Feb-14 at 13:31

            Whenever I am debugging the library, I avoid using the CLI and render scenes directly from the file. Just add a snippet like this:

            Source https://stackoverflow.com/questions/70869433

            QUESTION

            Manim exception in text mobject example
            Asked 2022-Feb-13 at 10:13

            I'm trying to run this example from Manim community documentation:

            ...

            ANSWER

            Answered 2022-Feb-13 at 10:13

            Can only add answers and no comments yet (apologies) -- you could try to upgrade manimpango via pip install -U manimpango. As a workaround, using Tex instead would also work as long as you have LaTeX installed.

            Source https://stackoverflow.com/questions/70891586

            QUESTION

            How do I pass arguments to Manim Community via command line?
            Asked 2022-Feb-13 at 10:05

            Manim Renders scene(s) to an output file with,

            ...

            ANSWER

            Answered 2022-Feb-13 at 10:05

            I'm not sure I fully understand your first question regarding arguments -- do you mean custom arguments? We don't have support for that yet.

            However, you can definitely render scenes from your Python script directly by using a snippet like this:

            Source https://stackoverflow.com/questions/70896199

            QUESTION

            Add buff only in one end of a manim line / arrow
            Asked 2022-Feb-13 at 09:54

            I am connecting two rectangles with a line with a tip or an arrow (it doesn't matter which one). I only want buff at the end of the arrow, not both start and end.

            ...

            ANSWER

            Answered 2022-Feb-13 at 09:54

            Unfortunately buff is a symmetric quantity. You'll have to modify the end points manually to get the desired effect.

            Source https://stackoverflow.com/questions/71085043

            QUESTION

            Javascript: frame precise video stop
            Asked 2022-Jan-28 at 14:55

            I would like to be able to robustly stop a video when the video arrives on some specified frames in order to do oral presentations based on videos made with Blender, Manim...

            I'm aware of this question, but the problem is that the video does not stops exactly at the good frame. Sometimes it continues forward for one frame and when I force it to come back to the initial frame we see the video going backward, which is weird. Even worse, if the next frame is completely different (different background...) this will be very visible.

            To illustrate my issues, I created a demo project here (just click "next" and see that when the video stops, sometimes it goes backward). The full code is here.

            The important part of the code I'm using is:

            ...

            ANSWER

            Answered 2022-Jan-21 at 19:18

            The video has frame rate of 25fps, and not 24fps:

            After putting the correct value it works ok: demo
            The VideoFrame api heavily relies on FPS provided by you. You can find FPS of your videos offline and send as metadata along with stop frames from server.

            The site videoplayer.handmadeproductions.de uses window.requestAnimationFrame() to get the callback.

            There is a new better alternative to requestAnimationFrame. The requestVideoFrameCallback(), allows us to do per-video-frame operations on video.
            The same functionality, you domed in OP, can be achieved like this:

            Source https://stackoverflow.com/questions/70613008

            QUESTION

            ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
            Asked 2022-Jan-28 at 03:50

            Error while installing manimce, I have been trying to install manimce library on windows subsystem for linux and after running

            ...

            ANSWER

            Answered 2022-Jan-28 at 02:24
            apt-get install sox ffmpeg libcairo2 libcairo2-dev
            apt-get install texlive-full
            pip3 install manimlib  # or pip install manimlib
            

            Source https://stackoverflow.com/questions/70508775

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install manim

            WARNING: These instructions are for ManimGL only. Trying to use these instructions to install ManimCommunity/manim or instructions there to install this version will cause problems. You should first decide which version you wish to install, then only follow the instructions for your desired version. Note: To install manim directly through pip, please pay attention to the name of the installed package. This repository is ManimGL of 3b1b. The package name is manimgl instead of manim or manimlib. Please use pip install manimgl to install the version in this repository. Manim runs on Python 3.6 or higher (Python 3.8 is recommended).
            Install LaTeX as above.
            Create a conda environment using conda create -n manim python=3.8.
            Activate the environment using conda activate manim.
            Install manimgl using pip install -e ..

            Support

            Documentation is in progress at 3b1b.github.io/manim. And there is also a Chinese version maintained by @manim-kindergarten: docs.manim.org.cn (in Chinese). manim-kindergarten wrote and collected some useful extra classes and some codes of videos in manim_sandbox repo.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link