-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Docs #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs #347
Changes from all commits
c808ca9
9e43912
e11418d
5a7eea3
4880210
a539a40
d2a5ff2
d094efe
ab78278
f8fae7a
aa5cb79
fee423d
63a7972
47e5d8a
909c93b
9406590
058e6cc
21eafe5
56cdb7a
f0ff2f0
e9a48ea
c98c80e
0f34d12
428a316
cd2555f
ca16dcb
7dc24ad
f1c6cf6
b86b16e
2031f75
721cb07
e38a4db
8a1f039
88d56b1
4eab0cc
25e82d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| td { | ||
| padding: 0px 10px 0px 10px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| """Animate mobjects.""" | ||
| from copy import deepcopy | ||
|
|
||
| import numpy as np | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,4 @@ | ||||||
| """ | ||||||
| MObject: Base classes for all mathematical objects. | ||||||
| """ | ||||||
| """Base classes for objects that can be displayed.""" | ||||||
| from functools import reduce | ||||||
| import copy | ||||||
| import itertools as it | ||||||
|
|
@@ -30,8 +28,13 @@ | |||||
|
|
||||||
|
|
||||||
| class Mobject(Container): | ||||||
| """ | ||||||
| Mathematical Object | ||||||
| """Mathematical Object: base class for objects that can be displayed on screen. | ||||||
|
|
||||||
| Attributes | ||||||
| ---------- | ||||||
| submobjects : :class:`list` | ||||||
| The contained objects. | ||||||
|
|
||||||
| """ | ||||||
|
|
||||||
| CONFIG = { | ||||||
|
|
@@ -69,6 +72,37 @@ def generate_points(self): | |||||
| pass | ||||||
|
|
||||||
| def add(self, *mobjects): | ||||||
| """Add mobjects as submobjects. | ||||||
|
|
||||||
| The mobjects are added to self.submobjects. | ||||||
|
|
||||||
| Parameters | ||||||
| ---------- | ||||||
| mobjects : List[:class:`Mobject`] | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we aren't expecting lists of mobjects, right?
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| The mobjects to add. | ||||||
|
|
||||||
| Returns | ||||||
| ------- | ||||||
| :class:`Mobject` | ||||||
| :code:`self` | ||||||
|
|
||||||
| Raises | ||||||
| ------ | ||||||
| :class:`ValueError` | ||||||
| When a mobject tries to add itself. | ||||||
|
|
||||||
| Notes | ||||||
| ----- | ||||||
| A mobject cannot contain itself, and it cannot contain a submobject | ||||||
| more than once. If the parent mobject is displayed, the newly-added | ||||||
| submobjects will also be displayed (i.e. they are automatically added | ||||||
| to the parent Scene). | ||||||
|
|
||||||
| See Also | ||||||
| -------- | ||||||
| :meth:`~Mobject.remove` | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i mean this can be shortened to just "remove" but we can let it be i guess |
||||||
|
|
||||||
| """ | ||||||
| if self in mobjects: | ||||||
| raise ValueError("Mobject cannot contain self") | ||||||
| self.submobjects = list_update(self.submobjects, mobjects) | ||||||
|
|
@@ -80,6 +114,25 @@ def add_to_back(self, *mobjects): | |||||
| return self | ||||||
|
|
||||||
| def remove(self, *mobjects): | ||||||
| """Remove submobjects. | ||||||
|
|
||||||
| The mobjects are removed from self.submobjects, if they exist. | ||||||
|
|
||||||
| Parameters | ||||||
| ---------- | ||||||
| mobjects : List[:class:`Mobject`] | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| The mobjects to remove. | ||||||
|
|
||||||
| Returns | ||||||
| ------- | ||||||
| :class:`Mobject` | ||||||
| :code:`self` | ||||||
|
|
||||||
| See Also | ||||||
| -------- | ||||||
| :meth:`~Mobject.add` | ||||||
|
|
||||||
| """ | ||||||
| for mobject in mobjects: | ||||||
| if mobject in self.submobjects: | ||||||
| self.submobjects.remove(mobject) | ||||||
|
|
@@ -1097,6 +1150,8 @@ def set_z_index_by_z_coordinate(self): | |||||
|
|
||||||
|
|
||||||
| class Group(Mobject): | ||||||
| """Groups together multiple Mobjects.""" | ||||||
|
|
||||||
| def __init__(self, *mobjects, **kwargs): | ||||||
| if not all([isinstance(m, Mobject) for m in mobjects]): | ||||||
| raise Exception("All submobjects must be of type Mobject") | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| """Mobject representing a number line.""" | ||
| import operator as op | ||
|
|
||
| from ..constants import * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| """Mobjects generated from an SVG file.""" | ||
| import itertools as it | ||
| import re | ||
| import os | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| """Mobjects that use vector graphics.""" | ||
| import itertools as it | ||
| import sys | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| """A Scene is the canvas of the animation.""" | ||
| import inspect | ||
| import random | ||
| import warnings | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.