mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
copy docs
This commit is contained in:
parent
46336a2738
commit
e59178dae7
20 changed files with 1049 additions and 0 deletions
19
docs/Makefile
Normal file
19
docs/Makefile
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Minimal makefile for Sphinx documentation
|
||||||
|
#
|
||||||
|
|
||||||
|
# You can set these variables from the command line.
|
||||||
|
SPHINXOPTS =
|
||||||
|
SPHINXBUILD = sphinx-build
|
||||||
|
SOURCEDIR = .
|
||||||
|
BUILDDIR = _build
|
||||||
|
|
||||||
|
# Put it first so that "make" without argument is like "make help".
|
||||||
|
help:
|
||||||
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
|
|
||||||
|
.PHONY: help Makefile
|
||||||
|
|
||||||
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||||
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||||
|
%: Makefile
|
||||||
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
11
docs/about.rst
Normal file
11
docs/about.rst
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
About
|
||||||
|
=====
|
||||||
|
|
||||||
|
Animating technical concepts is traditionally pretty tedious, since it can be
|
||||||
|
difficult to make the animations precise enough to convey them accurately.
|
||||||
|
``manim`` uses Python to generate animations programmatically, which makes it
|
||||||
|
possible to specify exactly how each one should run.
|
||||||
|
|
||||||
|
This project is still very much a work in progress, but I hope the the
|
||||||
|
information here will make it easier for newcomers to get started using
|
||||||
|
``manim``.
|
82
docs/animation.rst
Normal file
82
docs/animation.rst
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
``animation`` --- Making things move
|
||||||
|
====================================
|
||||||
|
|
||||||
|
``animation.animation``
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.animation
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.composition``
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.composition
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.creation``
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.creation
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.indication``
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.indication
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.movement``
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.movement
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.numbers``
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.numbers
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.rotation``
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.rotation
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.specialized``
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.specialized
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.transform``
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.transform
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``animation.update``
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: animation.update
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
42
docs/camera.rst
Normal file
42
docs/camera.rst
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
``camera`` --- Create Images
|
||||||
|
============================
|
||||||
|
|
||||||
|
``camera.camera``
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
.. automodule:: camera.camera
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``camera.mapping_camera``
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
.. automodule:: camera.mapping_camera
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``camera.moving_camera``
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: camera.moving_camera
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``camera.multi_camera``
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
.. automodule:: camera.multi_camera
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``camera.three_d_camera``
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
.. automodule:: camera.three_d_camera
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
184
docs/conf.py
Normal file
184
docs/conf.py
Normal file
|
@ -0,0 +1,184 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Configuration file for the Sphinx documentation builder.
|
||||||
|
#
|
||||||
|
# This file does only contain a selection of the most common options. For a
|
||||||
|
# full list see the documentation:
|
||||||
|
# http://www.sphinx-doc.org/en/master/config
|
||||||
|
|
||||||
|
# -- Path setup --------------------------------------------------------------
|
||||||
|
|
||||||
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
|
#
|
||||||
|
# import os
|
||||||
|
# import sys
|
||||||
|
# sys.path.insert(0, os.path.abspath('.'))
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
sys.path.insert(0, os.path.abspath(".."))
|
||||||
|
|
||||||
|
|
||||||
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
|
project = 'manim'
|
||||||
|
copyright = '2018, 3Blue1Brown, EulerTour'
|
||||||
|
author = '3Blue1Brown, EulerTour'
|
||||||
|
|
||||||
|
# The short X.Y version
|
||||||
|
version = ''
|
||||||
|
# The full version, including alpha/beta/rc tags
|
||||||
|
release = '0.1'
|
||||||
|
|
||||||
|
|
||||||
|
# -- General configuration ---------------------------------------------------
|
||||||
|
|
||||||
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
|
#
|
||||||
|
# needs_sphinx = '1.0'
|
||||||
|
|
||||||
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
|
# ones.
|
||||||
|
extensions = [
|
||||||
|
'sphinx.ext.autodoc',
|
||||||
|
'sphinx.ext.coverage',
|
||||||
|
'sphinx.ext.mathjax',
|
||||||
|
'sphinx.ext.viewcode',
|
||||||
|
]
|
||||||
|
|
||||||
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
|
templates_path = ['_templates']
|
||||||
|
|
||||||
|
# The suffix(es) of source filenames.
|
||||||
|
# You can specify multiple suffix as a list of string:
|
||||||
|
#
|
||||||
|
# source_suffix = ['.rst', '.md']
|
||||||
|
source_suffix = '.rst'
|
||||||
|
|
||||||
|
# The master toctree document.
|
||||||
|
master_doc = 'index'
|
||||||
|
|
||||||
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
|
# for a list of supported languages.
|
||||||
|
#
|
||||||
|
# This is also used if you do content translation via gettext catalogs.
|
||||||
|
# Usually you set "language" from the command line for these cases.
|
||||||
|
language = None
|
||||||
|
|
||||||
|
# List of patterns, relative to source directory, that match files and
|
||||||
|
# directories to ignore when looking for source files.
|
||||||
|
# This pattern also affects html_static_path and html_extra_path.
|
||||||
|
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||||
|
|
||||||
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
|
pygments_style = None
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
|
||||||
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
|
# a list of builtin themes.
|
||||||
|
html_theme = 'sphinx_rtd_theme'
|
||||||
|
|
||||||
|
# Theme options are theme-specific and customize the look and feel of a theme
|
||||||
|
# further. For a list of options available for each theme, see the
|
||||||
|
# documentation.
|
||||||
|
#
|
||||||
|
html_theme_options = {
|
||||||
|
'collapse_navigation': False,
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
|
html_static_path = ['_static']
|
||||||
|
|
||||||
|
# Custom sidebar templates, must be a dictionary that maps document names
|
||||||
|
# to template names.
|
||||||
|
#
|
||||||
|
# The default sidebars (for documents that don't match any pattern) are
|
||||||
|
# defined by theme itself. Builtin themes are using these templates by
|
||||||
|
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
|
||||||
|
# 'searchbox.html']``.
|
||||||
|
#
|
||||||
|
# html_sidebars = {}
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for HTMLHelp output ---------------------------------------------
|
||||||
|
|
||||||
|
# Output file base name for HTML help builder.
|
||||||
|
htmlhelp_basename = 'manimdoc'
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for LaTeX output ------------------------------------------------
|
||||||
|
|
||||||
|
latex_elements = {
|
||||||
|
# The paper size ('letterpaper' or 'a4paper').
|
||||||
|
#
|
||||||
|
# 'papersize': 'letterpaper',
|
||||||
|
|
||||||
|
# The font size ('10pt', '11pt' or '12pt').
|
||||||
|
#
|
||||||
|
# 'pointsize': '10pt',
|
||||||
|
|
||||||
|
# Additional stuff for the LaTeX preamble.
|
||||||
|
#
|
||||||
|
# 'preamble': '',
|
||||||
|
|
||||||
|
# Latex figure (float) alignment
|
||||||
|
#
|
||||||
|
# 'figure_align': 'htbp',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
|
# (source start file, target name, title,
|
||||||
|
# author, documentclass [howto, manual, or own class]).
|
||||||
|
latex_documents = [
|
||||||
|
(master_doc, 'manim.tex', 'manim Documentation',
|
||||||
|
'3Blue1Brown, EulerTour', 'manual'),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for manual page output ------------------------------------------
|
||||||
|
|
||||||
|
# One entry per manual page. List of tuples
|
||||||
|
# (source start file, name, description, authors, manual section).
|
||||||
|
man_pages = [
|
||||||
|
(master_doc, 'manim', 'manim Documentation',
|
||||||
|
[author], 1)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for Texinfo output ----------------------------------------------
|
||||||
|
|
||||||
|
# Grouping the document tree into Texinfo files. List of tuples
|
||||||
|
# (source start file, target name, title, author,
|
||||||
|
# dir menu entry, description, category)
|
||||||
|
texinfo_documents = [
|
||||||
|
(master_doc, 'manim', 'manim Documentation',
|
||||||
|
author, 'manim', 'One line description of project.',
|
||||||
|
'Miscellaneous'),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for Epub output -------------------------------------------------
|
||||||
|
|
||||||
|
# Bibliographic Dublin Core info.
|
||||||
|
epub_title = project
|
||||||
|
|
||||||
|
# The unique identifier of the text. This can be a ISBN number
|
||||||
|
# or the project homepage.
|
||||||
|
#
|
||||||
|
# epub_identifier = ''
|
||||||
|
|
||||||
|
# A unique identification for the text.
|
||||||
|
#
|
||||||
|
# epub_uid = ''
|
||||||
|
|
||||||
|
# A list of files that should not be packed into the epub file.
|
||||||
|
epub_exclude_files = ['search.html']
|
||||||
|
|
||||||
|
|
||||||
|
# -- Extension configuration -------------------------------------------------
|
34
docs/continual_animation.rst
Normal file
34
docs/continual_animation.rst
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
``continual_animation`` --- Animations in the Background
|
||||||
|
========================================================
|
||||||
|
|
||||||
|
``continual_animation.continual_animation``
|
||||||
|
------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: continual_animation.continual_animation
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``continual_animation.from_animation``
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: continual_animation.from_animation
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``continual_animation.numbers``
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: continual_animation.numbers
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``continual_animation.update``
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: continual_animation.update
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
18
docs/getting_started.rst
Normal file
18
docs/getting_started.rst
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
Getting Started
|
||||||
|
===============
|
||||||
|
|
||||||
|
Todd Zimmerman put together `a very nice tutorial`_ on getting started with
|
||||||
|
``manim``, but is unfortunately outdated. It's still useful for understanding
|
||||||
|
how ``manim`` is used, but the examples won't run on the latest version of
|
||||||
|
``manim``.
|
||||||
|
|
||||||
|
.. _a very nice tutorial: https://talkingphysics.wordpress.com/2018/06/11/learning-how-to-animate-videos-using-``manim``-series-a-journey/
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:caption: Contents:
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
getting_started/learning_by_example
|
||||||
|
getting_started/mathematical_objects
|
||||||
|
getting_started/animating_mobjects
|
||||||
|
getting_started/making_a_scene
|
4
docs/getting_started/animating_mobjects.rst
Normal file
4
docs/getting_started/animating_mobjects.rst
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Animating Mobjects
|
||||||
|
==================
|
||||||
|
|
||||||
|
Learn about animations.
|
132
docs/getting_started/learning_by_example.rst
Normal file
132
docs/getting_started/learning_by_example.rst
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
Learning by Example
|
||||||
|
===================
|
||||||
|
|
||||||
|
You create videos in manim by writing :class:`~scene.scene.Scene` instances.
|
||||||
|
``example_scenes.py`` contains a few simple ones that we can use to learn about
|
||||||
|
manim. For instance, take ``SquareToCircle``.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
class SquareToCircle(Scene):
|
||||||
|
def construct(self):
|
||||||
|
circle = Circle()
|
||||||
|
square = Square()
|
||||||
|
square.flip(RIGHT)
|
||||||
|
square.rotate(-3 * TAU / 8)
|
||||||
|
circle.set_fill(PINK, opacity=0.5)
|
||||||
|
|
||||||
|
self.play(ShowCreation(square))
|
||||||
|
self.play(Transform(square, circle))
|
||||||
|
self.play(FadeOut(square))
|
||||||
|
|
||||||
|
:meth:`~scene.scene.Scene.construct` specifies what is displayed on the screen
|
||||||
|
when the :class:`~scene.scene.Scene` is rendered to video. You can render a
|
||||||
|
:class:`~scene.scene.Scene` by running ``extract_scene.py``. Run ``python
|
||||||
|
extract_scene.py -h`` to see how it's used.
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
> python extract_scene.py -h
|
||||||
|
usage: extract_scene.py [-h] [-p] [-w] [-s] [-l] [-m] [-g] [-f] [-t] [-q] [-a]
|
||||||
|
[-o OUTPUT_NAME] [-n START_AT_ANIMATION_NUMBER]
|
||||||
|
[-r RESOLUTION] [-c COLOR] [-d OUTPUT_DIRECTORY]
|
||||||
|
file [scene_name]
|
||||||
|
|
||||||
|
positional arguments:
|
||||||
|
file path to file holding the python code for the scene
|
||||||
|
scene_name Name of the Scene class you want to see
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-p, --preview
|
||||||
|
-w, --write_to_movie
|
||||||
|
-s, --show_last_frame
|
||||||
|
-l, --low_quality
|
||||||
|
-m, --medium_quality
|
||||||
|
-g, --save_pngs
|
||||||
|
-f, --show_file_in_finder
|
||||||
|
-t, --transparent
|
||||||
|
-q, --quiet
|
||||||
|
-a, --write_all
|
||||||
|
-o OUTPUT_NAME, --output_name OUTPUT_NAME
|
||||||
|
-n START_AT_ANIMATION_NUMBER, --start_at_animation_number START_AT_ANIMATION_NUMBER
|
||||||
|
-r RESOLUTION, --resolution RESOLUTION
|
||||||
|
-c COLOR, --color COLOR
|
||||||
|
-d OUTPUT_DIRECTORY, --output_directory OUTPUT_DIRECTORY
|
||||||
|
|
||||||
|
The most common flags are ``-p``, to automatically play the generated video,
|
||||||
|
``-l``, to render in lower quality in favor of speed, and ``-s``, to show the
|
||||||
|
last frame of the :class:`~scene.scene.Scene` for faster development. Run
|
||||||
|
``python extract_scene.py example_scenes.py SquareToCircle -pl`` to produce a
|
||||||
|
file called SquareToCircle.mp4 in the media directory that you have configured,
|
||||||
|
and automatically play it.
|
||||||
|
|
||||||
|
.. raw:: html
|
||||||
|
|
||||||
|
<iframe width="560" height="315" src="https://www.youtube.com/embed/8tvYDIGLJJA?ecver=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
|
||||||
|
|
||||||
|
Let's step through each line of the :class:`~scene.scene.Scene`. Lines 3 and 4
|
||||||
|
instantiate a :class:`~mobject.geometry.Circle` and
|
||||||
|
:class:`~mobject.geometry.Square`, respectively. Both of these subclass
|
||||||
|
:class:`~mobject.mobject.Mobject`, the base class for objects in manim. Note
|
||||||
|
that instantiating a :class:`~mobject.mobject.Mobject` does not add it to the
|
||||||
|
:class:`~scene.scene.Scene`, so you wouldn't see anything if you were to render
|
||||||
|
the :class:`~scene.scene.Scene` at this point.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
:linenos:
|
||||||
|
:lineno-start: 3
|
||||||
|
|
||||||
|
circle = Circle()
|
||||||
|
square = Square()
|
||||||
|
|
||||||
|
Lines 5, 6, and 7 apply various modifications to the mobjects before animating
|
||||||
|
them. The call to :meth:`~mobject.mobject.Mobject.flip` on line 5 flips the
|
||||||
|
:class:`~mobject.geometry.Square` across the RIGHT vector. This is equivalent
|
||||||
|
to a refection across the x-axis. Then the call to
|
||||||
|
:meth:`~mobject.mobject.Mobject.rotate` on line 6 rotates the
|
||||||
|
:class:`~mobject.geometry.Square` 3/8ths of a full rotation counterclockwise.
|
||||||
|
Finally, the call to :meth:`~mobject.mobject.Mobject.set_fill` on line 7 sets
|
||||||
|
the fill color for the :class:`~mobject.geometry.Circle` to pink, and its
|
||||||
|
opacity to 0.5.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
:linenos:
|
||||||
|
:lineno-start: 5
|
||||||
|
|
||||||
|
square.flip(RIGHT)
|
||||||
|
square.rotate(-3 * TAU / 8)
|
||||||
|
circle.set_fill(PINK, opacity=0.5)
|
||||||
|
|
||||||
|
Line 9 is the first to generate video.
|
||||||
|
:class:`~animation.creation.ShowCreation`,
|
||||||
|
:class:`~animation.transform.Transform`, and
|
||||||
|
:class:`~animation.creation.FadeOut` are
|
||||||
|
:class:`~animation.animation.Animation` instances. Each
|
||||||
|
:class:`~animation.animation.Animation` takes one or more
|
||||||
|
:class:`~mobject.mobject.Mobject` instances as arguments, which it animates
|
||||||
|
when passed to :meth:`~scene.scene.Scene.play`. This is how video is typically
|
||||||
|
created in manim. :class:`~mobject.mobject.Mobject` instances are automatically
|
||||||
|
added to the :class:`~scene.scene.Scene` when they are animated. You can add a
|
||||||
|
:class:`~mobject.mobject.Mobject` to the :class:`~scene.scene.Scene` manually
|
||||||
|
by passing it as an argument to :meth:`~scene.scene.Scene.add`.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
:linenos:
|
||||||
|
:lineno-start: 9
|
||||||
|
|
||||||
|
self.play(ShowCreation(square))
|
||||||
|
self.play(Transform(square, circle))
|
||||||
|
self.play(FadeOut(square))
|
||||||
|
|
||||||
|
:class:`~animation.creation.ShowCreation` draws a
|
||||||
|
:class:`~mobject.mobject.Mobject` to the screen,
|
||||||
|
:class:`~animation.transform.Transform` morphs one
|
||||||
|
:class:`~mobject.mobject.Mobject` into another, and
|
||||||
|
:class:`~animation.creation.FadeOut` fades a
|
||||||
|
:class:`~mobject.mobject.Mobject` out of the :class:`~scene.scene.Scene`. Note
|
||||||
|
that only the first argument to :class:`~animation.transform.Transform` is
|
||||||
|
modified, and the second is not added to the :class:`~scene.scene.Scene`. After
|
||||||
|
line 10 is executed ``square`` is a :class:`~mobject.geometry.Square` instance
|
||||||
|
with the shape of a :class:`~mobject.geometry.Circle`.
|
4
docs/getting_started/making_a_scene.rst
Normal file
4
docs/getting_started/making_a_scene.rst
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Making a Scene
|
||||||
|
==============
|
||||||
|
|
||||||
|
Talk about Scenes and organization, bring it all together.
|
13
docs/getting_started/mathematical_objects.rst
Normal file
13
docs/getting_started/mathematical_objects.rst
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Mathematical Objects
|
||||||
|
====================
|
||||||
|
|
||||||
|
Everything that appears on screen in a manim video is a
|
||||||
|
:class:`~mobject.mobject.Mobject`, or Mathematical Object. A
|
||||||
|
:class:`~mobject.mobject.Mobject`'s appearance is determined by 3
|
||||||
|
factors:
|
||||||
|
|
||||||
|
* ``m.points``, an Nx3 ``numpy.array`` specifying how to draw ``m``
|
||||||
|
* ``m``'s style attributes, such as ``m.color``, ``m.stroke_width``, and
|
||||||
|
``m.fill_opacity``
|
||||||
|
* ``m.submobjects``, a list of :class:`~mobject.mobject.Mobject` instances that
|
||||||
|
are considered part of ``m``
|
38
docs/index.rst
Normal file
38
docs/index.rst
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
.. manim documentation master file, created by
|
||||||
|
sphinx-quickstart on Sun Sep 23 10:43:32 2018.
|
||||||
|
You can adapt this file completely to your liking, but it should at least
|
||||||
|
contain the root `toctree` directive.
|
||||||
|
|
||||||
|
manim
|
||||||
|
=====
|
||||||
|
|
||||||
|
``manim`` is an animation engine for explanatory math videos. It uses Python to
|
||||||
|
make creating precise 2D animations simple and easy.
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:caption: Contents:
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
about
|
||||||
|
install
|
||||||
|
getting_started
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:caption: Module Index:
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
mobject
|
||||||
|
animation
|
||||||
|
continual_animation
|
||||||
|
scene
|
||||||
|
camera
|
||||||
|
utils
|
||||||
|
|
||||||
|
Indices and tables
|
||||||
|
==================
|
||||||
|
|
||||||
|
* :ref:`genindex`
|
||||||
|
* :ref:`modindex`
|
||||||
|
* :ref:`search`
|
||||||
|
|
||||||
|
|
18
docs/install.rst
Normal file
18
docs/install.rst
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
This fork of Manim runs on python 3.7 only. Earlier versions of python are not
|
||||||
|
supported. You can install the python dependencies with ``pip install -r
|
||||||
|
requirements.txt``.
|
||||||
|
|
||||||
|
manim relies on system libraries you will need to install on your operating
|
||||||
|
system:
|
||||||
|
|
||||||
|
* ffmpeg
|
||||||
|
* latex
|
||||||
|
* sox
|
||||||
|
|
||||||
|
The dockerfile is (should be) the definitive source for everything required by
|
||||||
|
``manim``.
|
||||||
|
|
||||||
|
|
35
docs/make.bat
Normal file
35
docs/make.bat
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
@ECHO OFF
|
||||||
|
|
||||||
|
pushd %~dp0
|
||||||
|
|
||||||
|
REM Command file for Sphinx documentation
|
||||||
|
|
||||||
|
if "%SPHINXBUILD%" == "" (
|
||||||
|
set SPHINXBUILD=sphinx-build
|
||||||
|
)
|
||||||
|
set SOURCEDIR=.
|
||||||
|
set BUILDDIR=_build
|
||||||
|
|
||||||
|
if "%1" == "" goto help
|
||||||
|
|
||||||
|
%SPHINXBUILD% >NUL 2>NUL
|
||||||
|
if errorlevel 9009 (
|
||||||
|
echo.
|
||||||
|
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||||
|
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||||
|
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||||
|
echo.may add the Sphinx directory to PATH.
|
||||||
|
echo.
|
||||||
|
echo.If you don't have Sphinx installed, grab it from
|
||||||
|
echo.http://sphinx-doc.org/
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:help
|
||||||
|
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
popd
|
134
docs/mobject.rst
Normal file
134
docs/mobject.rst
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
``mobject`` --- Mathematical Objects
|
||||||
|
====================================
|
||||||
|
|
||||||
|
Subpackages
|
||||||
|
-----------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
mobject.svg
|
||||||
|
mobject.types
|
||||||
|
|
||||||
|
``mobject.component`` --- Customizable Mobjects
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.component
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.coordinate_systems``
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.coordinate_systems
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.frame``
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.frame
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.functions`` --- VMobjects from Functions
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.functions
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.geometry`` --- Geometric Shapes
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.geometry
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.matrix`` --- Matrices
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.matrix
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.mobject`` --- Mathematical Objects
|
||||||
|
--------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.mobject
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
:member-order: bysource
|
||||||
|
:exclude-members:
|
||||||
|
__init__,
|
||||||
|
CONFIG
|
||||||
|
|
||||||
|
``mobject.number_line`` --- Number Lines
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.number_line
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.numbers`` --- Numbers
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.numbers
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.probability`` --- Probaility Visualizations
|
||||||
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.probability
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.shape_matchers`` --- Fit another Mobject
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.shape_matchers
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.three_d_shading_utils``
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.three_d_shading_utils
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.three_d_utils``
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.three_d_utils
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.three_dimensions``
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.three_dimensions
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``mobject.value_tracker``
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.value_tracker
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
46
docs/mobject.svg.rst
Normal file
46
docs/mobject.svg.rst
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
mobject.svg package
|
||||||
|
===================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
mobject.svg.brace module
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.svg.brace
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mobject.svg.drawings module
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.svg.drawings
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mobject.svg.svg\_mobject module
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.svg.svg_mobject
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mobject.svg.tex\_mobject module
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.svg.tex_mobject
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.svg
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
38
docs/mobject.types.rst
Normal file
38
docs/mobject.types.rst
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
mobject.types package
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
mobject.types.image\_mobject module
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.types.image_mobject
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mobject.types.point\_cloud\_mobject module
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.types.point_cloud_mobject
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mobject.types.vectorized\_mobject module
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.types.vectorized_mobject
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: mobject.types
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
7
docs/modules.rst
Normal file
7
docs/modules.rst
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
mobject
|
||||||
|
=======
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 4
|
||||||
|
|
||||||
|
mobject
|
74
docs/scene.rst
Normal file
74
docs/scene.rst
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
``scene`` --- Organize Animations
|
||||||
|
=================================
|
||||||
|
|
||||||
|
``scene.graph_scene``
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.graph_scene
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``scene.moving_camera_scene``
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.moving_camera_scene
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``scene.reconfigurable_scene``
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.reconfigurable_scene
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``scene.sample_space_scene``
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.sample_space_scene
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``scene.scene``
|
||||||
|
------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.scene
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``scene.scene_from_video``
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.scene_from_video
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``scene.three_d_scene``
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.three_d_scene
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``scene.vector_space_scene``
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.vector_space_scene
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``scene.zoomed_scene``
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: scene.zoomed_scene
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
116
docs/utils.rst
Normal file
116
docs/utils.rst
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
``utils`` --- Make Common Tasks Easier
|
||||||
|
======================================
|
||||||
|
|
||||||
|
``utils.bezier module``
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.bezier
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.color module``
|
||||||
|
------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.color
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.config_ops module``
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.config_ops
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.images module``
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.images
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.iterables module``
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.iterables
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.output_directory_getters module``
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.output_directory_getters
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.paths module``
|
||||||
|
------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.paths
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.rate_functions module``
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.rate_functions
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.save module``
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
.. automodule:: utils.save
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.simple_functions module``
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.simple_functions
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.sounds module``
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.sounds
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.space_ops module``
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.space_ops
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.strings module``
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.strings
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
``utils.tex_file_writing module``
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. automodule:: utils.tex_file_writing
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue