mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 05:24:22 +08:00
DEFAULT_CONFIG -> CONFIG
This commit is contained in:
@ -12,7 +12,7 @@ from helpers import *
|
|||||||
from mobject import Mobject
|
from mobject import Mobject
|
||||||
|
|
||||||
class Animation(object):
|
class Animation(object):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"run_time" : DEFAULT_ANIMATION_RUN_TIME,
|
"run_time" : DEFAULT_ANIMATION_RUN_TIME,
|
||||||
"rate_func" : smooth,
|
"rate_func" : smooth,
|
||||||
"name" : None,
|
"name" : None,
|
||||||
|
@ -9,7 +9,7 @@ from topics.geometry import Line
|
|||||||
from helpers import *
|
from helpers import *
|
||||||
|
|
||||||
class Vibrate(Animation):
|
class Vibrate(Animation):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"spatial_period" : 6,
|
"spatial_period" : 6,
|
||||||
"temporal_period" : 1,
|
"temporal_period" : 1,
|
||||||
"overtones" : 4,
|
"overtones" : 4,
|
||||||
@ -48,7 +48,7 @@ class Vibrate(Animation):
|
|||||||
|
|
||||||
|
|
||||||
class TurnInsideOut(Transform):
|
class TurnInsideOut(Transform):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"path_func" : path_along_arc(np.pi/2)
|
"path_func" : path_along_arc(np.pi/2)
|
||||||
}
|
}
|
||||||
def __init__(self, mobject, **kwargs):
|
def __init__(self, mobject, **kwargs):
|
||||||
|
@ -8,7 +8,7 @@ from animation import Animation
|
|||||||
|
|
||||||
|
|
||||||
class Rotating(Animation):
|
class Rotating(Animation):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"axes" : [RIGHT, UP],
|
"axes" : [RIGHT, UP],
|
||||||
"axis" : None,
|
"axis" : None,
|
||||||
"radians" : 2*np.pi,
|
"radians" : 2*np.pi,
|
||||||
@ -57,7 +57,7 @@ class ShowCreation(ShowPartial):
|
|||||||
return (0, alpha)
|
return (0, alpha)
|
||||||
|
|
||||||
class ShowPassingFlash(ShowPartial):
|
class ShowPassingFlash(ShowPartial):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"time_width" : 0.1
|
"time_width" : 0.1
|
||||||
}
|
}
|
||||||
def get_bounds(self, alpha):
|
def get_bounds(self, alpha):
|
||||||
@ -71,7 +71,7 @@ class ShowPassingFlash(ShowPartial):
|
|||||||
|
|
||||||
|
|
||||||
class Flash(Animation):
|
class Flash(Animation):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : "white",
|
"color" : "white",
|
||||||
"slow_factor" : 0.01,
|
"slow_factor" : 0.01,
|
||||||
"run_time" : 0.1,
|
"run_time" : 0.1,
|
||||||
@ -111,7 +111,7 @@ class Homotopy(Animation):
|
|||||||
])
|
])
|
||||||
|
|
||||||
class PhaseFlow(Animation):
|
class PhaseFlow(Animation):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"virtual_time" : 1
|
"virtual_time" : 1
|
||||||
}
|
}
|
||||||
def __init__(self, function, mobject, **kwargs):
|
def __init__(self, function, mobject, **kwargs):
|
||||||
@ -154,7 +154,7 @@ class DelayByOrder(Animation):
|
|||||||
|
|
||||||
Warning: This will not work on all animation types.
|
Warning: This will not work on all animation types.
|
||||||
"""
|
"""
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"max_power" : 5
|
"max_power" : 5
|
||||||
}
|
}
|
||||||
def __init__(self, animation, **kwargs):
|
def __init__(self, animation, **kwargs):
|
||||||
|
@ -11,7 +11,7 @@ from simple_animations import DelayByOrder
|
|||||||
from mobject import Mobject, Point
|
from mobject import Mobject, Point
|
||||||
|
|
||||||
class Transform(Animation):
|
class Transform(Animation):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"path_func" : straight_path,
|
"path_func" : straight_path,
|
||||||
"should_black_out_extra_points" : False
|
"should_black_out_extra_points" : False
|
||||||
}
|
}
|
||||||
@ -75,12 +75,12 @@ class Transform(Animation):
|
|||||||
)
|
)
|
||||||
|
|
||||||
class ClockwiseTransform(Transform):
|
class ClockwiseTransform(Transform):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"path_func" : clockwise_path()
|
"path_func" : clockwise_path()
|
||||||
}
|
}
|
||||||
|
|
||||||
class CounterclockwiseTransform(Transform):
|
class CounterclockwiseTransform(Transform):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"path_func" : counterclockwise_path()
|
"path_func" : counterclockwise_path()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ class GrowFromCenter(Transform):
|
|||||||
Transform.__init__(self, mobject, target, **kwargs)
|
Transform.__init__(self, mobject, target, **kwargs)
|
||||||
|
|
||||||
class SpinInFromNothing(GrowFromCenter):
|
class SpinInFromNothing(GrowFromCenter):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"path_func" : counterclockwise_path()
|
"path_func" : counterclockwise_path()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ class ShimmerIn(DelayByOrder):
|
|||||||
|
|
||||||
|
|
||||||
class Rotate(ApplyMethod):
|
class Rotate(ApplyMethod):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"in_place" : False,
|
"in_place" : False,
|
||||||
}
|
}
|
||||||
def __init__(self, mobject, angle = np.pi, axis = OUT, **kwargs):
|
def __init__(self, mobject, angle = np.pi, axis = OUT, **kwargs):
|
||||||
@ -157,7 +157,7 @@ class Rotate(ApplyMethod):
|
|||||||
|
|
||||||
|
|
||||||
class ApplyPointwiseFunction(ApplyMethod):
|
class ApplyPointwiseFunction(ApplyMethod):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"run_time" : DEFAULT_POINTWISE_FUNCTION_RUN_TIME
|
"run_time" : DEFAULT_POINTWISE_FUNCTION_RUN_TIME
|
||||||
}
|
}
|
||||||
def __init__(self, function, mobject, **kwargs):
|
def __init__(self, function, mobject, **kwargs):
|
||||||
@ -206,7 +206,7 @@ class ApplyMatrix(Animation):
|
|||||||
|
|
||||||
|
|
||||||
class TransformAnimations(Transform):
|
class TransformAnimations(Transform):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"rate_func" : squish_rate_func(smooth)
|
"rate_func" : squish_rate_func(smooth)
|
||||||
}
|
}
|
||||||
def __init__(self, start_anim, end_anim, **kwargs):
|
def __init__(self, start_anim, end_anim, **kwargs):
|
||||||
|
@ -32,7 +32,7 @@ RANDY_SCALE_VAL = 0.3
|
|||||||
|
|
||||||
|
|
||||||
class Cycloid(ParametricFunction):
|
class Cycloid(ParametricFunction):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"point_a" : 6*LEFT+3*UP,
|
"point_a" : 6*LEFT+3*UP,
|
||||||
"radius" : 2,
|
"radius" : 2,
|
||||||
"end_theta" : 3*np.pi/2,
|
"end_theta" : 3*np.pi/2,
|
||||||
@ -52,7 +52,7 @@ class Cycloid(ParametricFunction):
|
|||||||
])
|
])
|
||||||
|
|
||||||
class LoopTheLoop(ParametricFunction):
|
class LoopTheLoop(ParametricFunction):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : YELLOW_D,
|
"color" : YELLOW_D,
|
||||||
"density" : 20*DEFAULT_POINT_DENSITY_1D
|
"density" : 20*DEFAULT_POINT_DENSITY_1D
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ class LoopTheLoop(ParametricFunction):
|
|||||||
|
|
||||||
|
|
||||||
class SlideWordDownCycloid(Animation):
|
class SlideWordDownCycloid(Animation):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"rate_func" : None,
|
"rate_func" : None,
|
||||||
"run_time" : 8
|
"run_time" : 8
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ class BrachistochroneWordSliding(Scene):
|
|||||||
|
|
||||||
|
|
||||||
class PathSlidingScene(Scene):
|
class PathSlidingScene(Scene):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"gravity" : 3,
|
"gravity" : 3,
|
||||||
"delta_t" : 0.05
|
"delta_t" : 0.05
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ from scene import Scene
|
|||||||
from brachistochrone.curves import Cycloid
|
from brachistochrone.curves import Cycloid
|
||||||
|
|
||||||
class Lens(Arc):
|
class Lens(Arc):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"radius" : 2,
|
"radius" : 2,
|
||||||
"angle" : np.pi/2,
|
"angle" : np.pi/2,
|
||||||
"color" : BLUE_B,
|
"color" : BLUE_B,
|
||||||
@ -86,7 +86,7 @@ class SimplePhoton(PhotonScene):
|
|||||||
|
|
||||||
|
|
||||||
class MultipathPhotonScene(PhotonScene):
|
class MultipathPhotonScene(PhotonScene):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"num_paths" : 5
|
"num_paths" : 5
|
||||||
}
|
}
|
||||||
def run_along_paths(self):
|
def run_along_paths(self):
|
||||||
@ -307,7 +307,7 @@ class ShowMultiplePathsInGlass(ShowMultiplePathsScene):
|
|||||||
|
|
||||||
|
|
||||||
class MultilayeredGlass(PhotonScene):
|
class MultilayeredGlass(PhotonScene):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"num_discrete_layers" : 5,
|
"num_discrete_layers" : 5,
|
||||||
"num_variables" : 3,
|
"num_variables" : 3,
|
||||||
"top_color" : BLUE_E,
|
"top_color" : BLUE_E,
|
||||||
|
@ -10,7 +10,7 @@ import progressbar
|
|||||||
from helpers import *
|
from helpers import *
|
||||||
|
|
||||||
class Camera(object):
|
class Camera(object):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
#background of a different shape will overwrite this
|
#background of a different shape will overwrite this
|
||||||
"pixel_shape" : (DEFAULT_HEIGHT, DEFAULT_WIDTH),
|
"pixel_shape" : (DEFAULT_HEIGHT, DEFAULT_WIDTH),
|
||||||
#this will be resized to match pixel_shape
|
#this will be resized to match pixel_shape
|
||||||
@ -177,7 +177,7 @@ class MovingCamera(Camera):
|
|||||||
Stays in line with the height, width and position
|
Stays in line with the height, width and position
|
||||||
of a given mobject
|
of a given mobject
|
||||||
"""
|
"""
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"aligned_dimension" : "width" #or height
|
"aligned_dimension" : "width" #or height
|
||||||
}
|
}
|
||||||
def __init__(self, mobject, **kwargs):
|
def __init__(self, mobject, **kwargs):
|
||||||
|
@ -10,7 +10,7 @@ import progressbar
|
|||||||
from helpers import *
|
from helpers import *
|
||||||
|
|
||||||
class Camera(object):
|
class Camera(object):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"pixel_width" : DEFAULT_WIDTH,
|
"pixel_width" : DEFAULT_WIDTH,
|
||||||
"pixel_height" : DEFAULT_HEIGHT,
|
"pixel_height" : DEFAULT_HEIGHT,
|
||||||
"space_height" : SPACE_HEIGHT,
|
"space_height" : SPACE_HEIGHT,
|
||||||
|
@ -15,7 +15,7 @@ from helpers import *
|
|||||||
|
|
||||||
|
|
||||||
class FluidFlow(Scene):
|
class FluidFlow(Scene):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"arrow_spacing" : 1,
|
"arrow_spacing" : 1,
|
||||||
"dot_spacing" : 0.5,
|
"dot_spacing" : 0.5,
|
||||||
"dot_color" : BLUE_C,
|
"dot_color" : BLUE_C,
|
||||||
@ -114,7 +114,7 @@ class FluidFlow(Scene):
|
|||||||
|
|
||||||
|
|
||||||
class NegativeDivergenceExamlpe(FluidFlow):
|
class NegativeDivergenceExamlpe(FluidFlow):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"points_width" : 2*SPACE_WIDTH,
|
"points_width" : 2*SPACE_WIDTH,
|
||||||
"points_height" : 2*SPACE_HEIGHT,
|
"points_height" : 2*SPACE_HEIGHT,
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ class QuadraticField(FluidFlow):
|
|||||||
|
|
||||||
|
|
||||||
class IncompressibleFluid(FluidFlow):
|
class IncompressibleFluid(FluidFlow):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"points_width" : 2*SPACE_WIDTH,
|
"points_width" : 2*SPACE_WIDTH,
|
||||||
"points_height" : 1.4*SPACE_HEIGHT
|
"points_height" : 1.4*SPACE_HEIGHT
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ class IncompressibleFluid(FluidFlow):
|
|||||||
|
|
||||||
|
|
||||||
class ConstantInwardFlow(FluidFlow):
|
class ConstantInwardFlow(FluidFlow):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"points_height" : 3*SPACE_HEIGHT,
|
"points_height" : 3*SPACE_HEIGHT,
|
||||||
"points_width" : 3*SPACE_WIDTH,
|
"points_width" : 3*SPACE_WIDTH,
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ class ConstantOutwardFlow(FluidFlow):
|
|||||||
|
|
||||||
|
|
||||||
class ConstantPositiveCurl(FluidFlow):
|
class ConstantPositiveCurl(FluidFlow):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"points_height" : SPACE_WIDTH,
|
"points_height" : SPACE_WIDTH,
|
||||||
}
|
}
|
||||||
def construct(self):
|
def construct(self):
|
||||||
@ -272,7 +272,7 @@ class ComplexCurlExample(FluidFlow):
|
|||||||
)
|
)
|
||||||
|
|
||||||
class SingleSwirl(FluidFlow):
|
class SingleSwirl(FluidFlow):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"points_height" : SPACE_WIDTH,
|
"points_height" : SPACE_WIDTH,
|
||||||
}
|
}
|
||||||
def construct(self):
|
def construct(self):
|
||||||
@ -287,7 +287,7 @@ class SingleSwirl(FluidFlow):
|
|||||||
|
|
||||||
|
|
||||||
class CurlArticleExample(FluidFlow):
|
class CurlArticleExample(FluidFlow):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"points_height" : 3*SPACE_HEIGHT,
|
"points_height" : 3*SPACE_HEIGHT,
|
||||||
"points_width" : 3*SPACE_WIDTH
|
"points_width" : 3*SPACE_WIDTH
|
||||||
}
|
}
|
||||||
@ -309,7 +309,7 @@ class CurlArticleExample(FluidFlow):
|
|||||||
|
|
||||||
|
|
||||||
class FourSwirlsWithoutCircles(FluidFlow):
|
class FourSwirlsWithoutCircles(FluidFlow):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"points_height" : SPACE_WIDTH,
|
"points_height" : SPACE_WIDTH,
|
||||||
}
|
}
|
||||||
def construct(self):
|
def construct(self):
|
||||||
|
@ -11,7 +11,7 @@ from helpers import *
|
|||||||
|
|
||||||
|
|
||||||
class LogoGeneration(Scene):
|
class LogoGeneration(Scene):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"radius" : 1.5,
|
"radius" : 1.5,
|
||||||
"inner_radius_ratio" : 0.55,
|
"inner_radius_ratio" : 0.55,
|
||||||
"circle_density" : 100,
|
"circle_density" : 100,
|
||||||
|
@ -12,7 +12,7 @@ class ImageMobject(Mobject):
|
|||||||
"""
|
"""
|
||||||
Automatically filters out black pixels
|
Automatically filters out black pixels
|
||||||
"""
|
"""
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"filter_color" : "black",
|
"filter_color" : "black",
|
||||||
"invert" : True,
|
"invert" : True,
|
||||||
"use_cache" : True,
|
"use_cache" : True,
|
||||||
|
@ -15,7 +15,7 @@ class Mobject(object):
|
|||||||
Mathematical Object
|
Mathematical Object
|
||||||
"""
|
"""
|
||||||
#Number of numbers used to describe a point (3 for pos, 3 for normal vector)
|
#Number of numbers used to describe a point (3 for pos, 3 for normal vector)
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : WHITE,
|
"color" : WHITE,
|
||||||
"point_thickness" : DEFAULT_POINT_THICKNESS,
|
"point_thickness" : DEFAULT_POINT_THICKNESS,
|
||||||
"name" : None,
|
"name" : None,
|
||||||
@ -533,7 +533,7 @@ class Mobject(object):
|
|||||||
|
|
||||||
|
|
||||||
class Point(Mobject):
|
class Point(Mobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : BLACK,
|
"color" : BLACK,
|
||||||
}
|
}
|
||||||
def __init__(self, location = ORIGIN, **kwargs):
|
def __init__(self, location = ORIGIN, **kwargs):
|
||||||
@ -545,7 +545,7 @@ class Point(Mobject):
|
|||||||
|
|
||||||
#TODO, Make the two implementations bellow non-redundant
|
#TODO, Make the two implementations bellow non-redundant
|
||||||
class Mobject1D(Mobject):
|
class Mobject1D(Mobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"density" : DEFAULT_POINT_DENSITY_1D,
|
"density" : DEFAULT_POINT_DENSITY_1D,
|
||||||
}
|
}
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
@ -568,7 +568,7 @@ class Mobject1D(Mobject):
|
|||||||
self.add_points(points, color = color)
|
self.add_points(points, color = color)
|
||||||
|
|
||||||
class Mobject2D(Mobject):
|
class Mobject2D(Mobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"density" : DEFAULT_POINT_DENSITY_2D,
|
"density" : DEFAULT_POINT_DENSITY_2D,
|
||||||
}
|
}
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
|
@ -10,7 +10,7 @@ from helpers import *
|
|||||||
|
|
||||||
#TODO, this whole class should be something vectorized.
|
#TODO, this whole class should be something vectorized.
|
||||||
class Region(Mobject):
|
class Region(Mobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"display_mode" : "region"
|
"display_mode" : "region"
|
||||||
}
|
}
|
||||||
def __init__(self, condition = (lambda x, y : True), **kwargs):
|
def __init__(self, condition = (lambda x, y : True), **kwargs):
|
||||||
|
@ -5,7 +5,7 @@ from helpers import *
|
|||||||
#TODO, Cleanup and refactor this file.
|
#TODO, Cleanup and refactor this file.
|
||||||
|
|
||||||
class TexMobject(Mobject):
|
class TexMobject(Mobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"template_tex_file" : TEMPLATE_TEX_FILE,
|
"template_tex_file" : TEMPLATE_TEX_FILE,
|
||||||
"color" : WHITE,
|
"color" : WHITE,
|
||||||
"point_thickness" : 1,
|
"point_thickness" : 1,
|
||||||
@ -39,14 +39,14 @@ class TexMobject(Mobject):
|
|||||||
|
|
||||||
|
|
||||||
class TextMobject(TexMobject):
|
class TextMobject(TexMobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"template_tex_file" : TEMPLATE_TEXT_FILE,
|
"template_tex_file" : TEMPLATE_TEXT_FILE,
|
||||||
"size" : "\\Large", #TODO, auto-adjust?
|
"size" : "\\Large", #TODO, auto-adjust?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Brace(TexMobject):
|
class Brace(TexMobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"buff" : 0.2,
|
"buff" : 0.2,
|
||||||
}
|
}
|
||||||
TEX_STRING = "\\underbrace{%s}"%(14*"\\quad")
|
TEX_STRING = "\\underbrace{%s}"%(14*"\\quad")
|
||||||
|
@ -94,7 +94,7 @@ class OpenInterval(Mobject):
|
|||||||
self.shift(center_point)
|
self.shift(center_point)
|
||||||
|
|
||||||
class Piano(ImageMobject):
|
class Piano(ImageMobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"point_thickness" : 1,
|
"point_thickness" : 1,
|
||||||
"invert" : False,
|
"invert" : False,
|
||||||
"scale_value" : 0.5
|
"scale_value" : 0.5
|
||||||
@ -127,7 +127,7 @@ class Piano(ImageMobject):
|
|||||||
|
|
||||||
|
|
||||||
class Vibrate(Animation):
|
class Vibrate(Animation):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"num_periods" : 1,
|
"num_periods" : 1,
|
||||||
"overtones" : 4,
|
"overtones" : 4,
|
||||||
"amplitude" : 0.5,
|
"amplitude" : 0.5,
|
||||||
|
@ -17,7 +17,7 @@ from tk_scene import TkSceneRoot
|
|||||||
from mobject import Mobject
|
from mobject import Mobject
|
||||||
|
|
||||||
class Scene(object):
|
class Scene(object):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"camera" : None,
|
"camera" : None,
|
||||||
"frame_duration" : DEFAULT_FRAME_DURATION,
|
"frame_duration" : DEFAULT_FRAME_DURATION,
|
||||||
"construct_args" : [],
|
"construct_args" : [],
|
||||||
|
@ -84,7 +84,7 @@ class RearrangeEquation(Scene):
|
|||||||
|
|
||||||
|
|
||||||
class FlipThroughSymbols(Animation):
|
class FlipThroughSymbols(Animation):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_center" : ORIGIN,
|
"start_center" : ORIGIN,
|
||||||
"end_center" : ORIGIN,
|
"end_center" : ORIGIN,
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ def part_name_to_directory(name):
|
|||||||
return os.path.join(PI_CREATURE_DIR, "pi_creature_"+name) + ".png"
|
return os.path.join(PI_CREATURE_DIR, "pi_creature_"+name) + ".png"
|
||||||
|
|
||||||
class PiCreature(Mobject):
|
class PiCreature(Mobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : BLUE_E
|
"color" : BLUE_E
|
||||||
}
|
}
|
||||||
PART_NAMES = [
|
PART_NAMES = [
|
||||||
@ -125,7 +125,7 @@ class Randolph(PiCreature):
|
|||||||
pass #Nothing more than an alternative name
|
pass #Nothing more than an alternative name
|
||||||
|
|
||||||
class Mortimer(PiCreature):
|
class Mortimer(PiCreature):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : MAROON_E
|
"color" : MAROON_E
|
||||||
}
|
}
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
@ -136,7 +136,7 @@ class Mortimer(PiCreature):
|
|||||||
|
|
||||||
|
|
||||||
class Mathematician(PiCreature):
|
class Mathematician(PiCreature):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : GREY,
|
"color" : GREY,
|
||||||
}
|
}
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
@ -145,7 +145,7 @@ class Mathematician(PiCreature):
|
|||||||
|
|
||||||
|
|
||||||
class Bubble(Mobject):
|
class Bubble(Mobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"direction" : LEFT,
|
"direction" : LEFT,
|
||||||
"center_point" : ORIGIN,
|
"center_point" : ORIGIN,
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ class Bubble(Mobject):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
class SpeechBubble(Bubble):
|
class SpeechBubble(Bubble):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"initial_width" : 6,
|
"initial_width" : 6,
|
||||||
"initial_height" : 4,
|
"initial_height" : 4,
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ class SpeechBubble(Bubble):
|
|||||||
return self.circle.get_center()
|
return self.circle.get_center()
|
||||||
|
|
||||||
class ThoughtBubble(Bubble):
|
class ThoughtBubble(Bubble):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"num_bulges" : 7,
|
"num_bulges" : 7,
|
||||||
"initial_inner_radius" : 1.8,
|
"initial_inner_radius" : 1.8,
|
||||||
"initial_width" : 6,
|
"initial_width" : 6,
|
||||||
|
@ -10,7 +10,7 @@ def complex_string(complex_num):
|
|||||||
return filter(lambda c : c not in "()", str(complex_num))
|
return filter(lambda c : c not in "()", str(complex_num))
|
||||||
|
|
||||||
class ComplexPlane(NumberPlane):
|
class ComplexPlane(NumberPlane):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : GREEN,
|
"color" : GREEN,
|
||||||
"unit_to_spatial_width" : 1,
|
"unit_to_spatial_width" : 1,
|
||||||
"line_frequency" : 1,
|
"line_frequency" : 1,
|
||||||
|
@ -15,7 +15,7 @@ def rotate(points, angle = np.pi, axis = OUT):
|
|||||||
|
|
||||||
|
|
||||||
class SpaceFillingCurve(Mobject1D):
|
class SpaceFillingCurve(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"radius" : 3,
|
"radius" : 3,
|
||||||
"order" : 5,
|
"order" : 5,
|
||||||
"start_color" : RED,
|
"start_color" : RED,
|
||||||
@ -33,7 +33,7 @@ class SpaceFillingCurve(Mobject1D):
|
|||||||
|
|
||||||
|
|
||||||
class LindenmayerCurve(SpaceFillingCurve):
|
class LindenmayerCurve(SpaceFillingCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"axiom" : "A",
|
"axiom" : "A",
|
||||||
"rule" : {},
|
"rule" : {},
|
||||||
"scale_factor" : 2,
|
"scale_factor" : 2,
|
||||||
@ -74,7 +74,7 @@ class LindenmayerCurve(SpaceFillingCurve):
|
|||||||
|
|
||||||
|
|
||||||
class SelfSimilarSpaceFillingCurve(SpaceFillingCurve):
|
class SelfSimilarSpaceFillingCurve(SpaceFillingCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"offsets" : [],
|
"offsets" : [],
|
||||||
#keys must awkwardly be in string form...
|
#keys must awkwardly be in string form...
|
||||||
"offset_to_rotation_axis" : {},
|
"offset_to_rotation_axis" : {},
|
||||||
@ -119,7 +119,7 @@ class SelfSimilarSpaceFillingCurve(SpaceFillingCurve):
|
|||||||
|
|
||||||
|
|
||||||
class HilbertCurve(SelfSimilarSpaceFillingCurve):
|
class HilbertCurve(SelfSimilarSpaceFillingCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"offsets" : [
|
"offsets" : [
|
||||||
LEFT+DOWN,
|
LEFT+DOWN,
|
||||||
LEFT+UP,
|
LEFT+UP,
|
||||||
@ -134,7 +134,7 @@ class HilbertCurve(SelfSimilarSpaceFillingCurve):
|
|||||||
|
|
||||||
|
|
||||||
class HilbertCurve3D(SelfSimilarSpaceFillingCurve):
|
class HilbertCurve3D(SelfSimilarSpaceFillingCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"offsets" : [
|
"offsets" : [
|
||||||
LEFT+DOWN+OUT,
|
LEFT+DOWN+OUT,
|
||||||
LEFT+UP+OUT,
|
LEFT+UP+OUT,
|
||||||
@ -149,7 +149,7 @@ class HilbertCurve3D(SelfSimilarSpaceFillingCurve):
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PeanoCurve(SelfSimilarSpaceFillingCurve):
|
class PeanoCurve(SelfSimilarSpaceFillingCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : PURPLE,
|
"start_color" : PURPLE,
|
||||||
"end_color" : TEAL,
|
"end_color" : TEAL,
|
||||||
"offsets" : [
|
"offsets" : [
|
||||||
@ -175,7 +175,7 @@ class PeanoCurve(SelfSimilarSpaceFillingCurve):
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TriangleFillingCurve(SelfSimilarSpaceFillingCurve):
|
class TriangleFillingCurve(SelfSimilarSpaceFillingCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : MAROON,
|
"start_color" : MAROON,
|
||||||
"end_color" : YELLOW,
|
"end_color" : YELLOW,
|
||||||
"offsets" : [
|
"offsets" : [
|
||||||
@ -193,7 +193,7 @@ class TriangleFillingCurve(SelfSimilarSpaceFillingCurve):
|
|||||||
}
|
}
|
||||||
|
|
||||||
# class HexagonFillingCurve(SelfSimilarSpaceFillingCurve):
|
# class HexagonFillingCurve(SelfSimilarSpaceFillingCurve):
|
||||||
# DEFAULT_CONFIG = {
|
# CONFIG = {
|
||||||
# "start_color" : WHITE,
|
# "start_color" : WHITE,
|
||||||
# "end_color" : BLUE_D,
|
# "end_color" : BLUE_D,
|
||||||
# "axis_offset_pairs" : [
|
# "axis_offset_pairs" : [
|
||||||
@ -217,7 +217,7 @@ class TriangleFillingCurve(SelfSimilarSpaceFillingCurve):
|
|||||||
|
|
||||||
|
|
||||||
class UtahFillingCurve(SelfSimilarSpaceFillingCurve):
|
class UtahFillingCurve(SelfSimilarSpaceFillingCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : WHITE,
|
"start_color" : WHITE,
|
||||||
"end_color" : BLUE_D,
|
"end_color" : BLUE_D,
|
||||||
"axis_offset_pairs" : [
|
"axis_offset_pairs" : [
|
||||||
@ -229,7 +229,7 @@ class UtahFillingCurve(SelfSimilarSpaceFillingCurve):
|
|||||||
|
|
||||||
|
|
||||||
class FlowSnake(LindenmayerCurve):
|
class FlowSnake(LindenmayerCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : YELLOW,
|
"start_color" : YELLOW,
|
||||||
"end_color" : GREEN,
|
"end_color" : GREEN,
|
||||||
"axiom" : "A",
|
"axiom" : "A",
|
||||||
@ -247,7 +247,7 @@ class FlowSnake(LindenmayerCurve):
|
|||||||
self.rotate(-self.order*np.pi/9)
|
self.rotate(-self.order*np.pi/9)
|
||||||
|
|
||||||
class Sierpinski(LindenmayerCurve):
|
class Sierpinski(LindenmayerCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : RED,
|
"start_color" : RED,
|
||||||
"end_color" : WHITE,
|
"end_color" : WHITE,
|
||||||
"axiom" : "A",
|
"axiom" : "A",
|
||||||
@ -262,7 +262,7 @@ class Sierpinski(LindenmayerCurve):
|
|||||||
}
|
}
|
||||||
|
|
||||||
class KochCurve(LindenmayerCurve):
|
class KochCurve(LindenmayerCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : BLUE_D,
|
"start_color" : BLUE_D,
|
||||||
"end_color" : WHITE,
|
"end_color" : WHITE,
|
||||||
"axiom" : "A--A--A--",
|
"axiom" : "A--A--A--",
|
||||||
@ -282,7 +282,7 @@ class KochCurve(LindenmayerCurve):
|
|||||||
|
|
||||||
|
|
||||||
class StellarCurve(LindenmayerCurve):
|
class StellarCurve(LindenmayerCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : RED,
|
"start_color" : RED,
|
||||||
"end_color" : BLUE_E,
|
"end_color" : BLUE_E,
|
||||||
"rule" : {
|
"rule" : {
|
||||||
@ -294,7 +294,7 @@ class StellarCurve(LindenmayerCurve):
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SnakeCurve(SpaceFillingCurve):
|
class SnakeCurve(SpaceFillingCurve):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : BLUE,
|
"start_color" : BLUE,
|
||||||
"end_color" : YELLOW,
|
"end_color" : YELLOW,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ from mobject import Mobject, Mobject1D, Mobject
|
|||||||
from helpers import *
|
from helpers import *
|
||||||
|
|
||||||
class FunctionGraph(Mobject1D):
|
class FunctionGraph(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : BLUE,
|
"color" : BLUE,
|
||||||
"x_min" : -10,
|
"x_min" : -10,
|
||||||
"x_max" : 10,
|
"x_max" : 10,
|
||||||
@ -27,7 +27,7 @@ class FunctionGraph(Mobject1D):
|
|||||||
|
|
||||||
|
|
||||||
class ParametricFunction(Mobject1D):
|
class ParametricFunction(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"start" : 0,
|
"start" : 0,
|
||||||
"end" : 1,
|
"end" : 1,
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ from helpers import *
|
|||||||
from mobject import Mobject, Mobject1D, Point
|
from mobject import Mobject, Mobject1D, Point
|
||||||
|
|
||||||
class Dot(Mobject1D): #Use 1D density, even though 2D
|
class Dot(Mobject1D): #Use 1D density, even though 2D
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"radius" : 0.05
|
"radius" : 0.05
|
||||||
}
|
}
|
||||||
def __init__(self, center_point = ORIGIN, **kwargs):
|
def __init__(self, center_point = ORIGIN, **kwargs):
|
||||||
@ -19,7 +19,7 @@ class Dot(Mobject1D): #Use 1D density, even though 2D
|
|||||||
])
|
])
|
||||||
|
|
||||||
class Cross(Mobject1D):
|
class Cross(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : YELLOW,
|
"color" : YELLOW,
|
||||||
"radius" : 0.3
|
"radius" : 0.3
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ class Cross(Mobject1D):
|
|||||||
|
|
||||||
|
|
||||||
class Line(Mobject1D):
|
class Line(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"buff" : 0
|
"buff" : 0
|
||||||
}
|
}
|
||||||
def __init__(self, start, end, **kwargs):
|
def __init__(self, start, end, **kwargs):
|
||||||
@ -83,7 +83,7 @@ class Line(Mobject1D):
|
|||||||
return rise/run
|
return rise/run
|
||||||
|
|
||||||
class Arrow(Line):
|
class Arrow(Line):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : YELLOW_C,
|
"color" : YELLOW_C,
|
||||||
"tip_length" : 0.25,
|
"tip_length" : 0.25,
|
||||||
"buff" : 0.3,
|
"buff" : 0.3,
|
||||||
@ -147,7 +147,7 @@ class CurvedLine(Line):
|
|||||||
|
|
||||||
|
|
||||||
class Arc(Mobject1D):
|
class Arc(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"radius" : 1.0,
|
"radius" : 1.0,
|
||||||
"start_angle" : 0,
|
"start_angle" : 0,
|
||||||
}
|
}
|
||||||
@ -167,14 +167,14 @@ class Arc(Mobject1D):
|
|||||||
])
|
])
|
||||||
|
|
||||||
class Circle(Arc):
|
class Circle(Arc):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : RED,
|
"color" : RED,
|
||||||
}
|
}
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
Arc.__init__(self, angle = 2*np.pi, **kwargs)
|
Arc.__init__(self, angle = 2*np.pi, **kwargs)
|
||||||
|
|
||||||
class Polygon(Mobject1D):
|
class Polygon(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : GREEN_D,
|
"color" : GREEN_D,
|
||||||
"edge_colors" : None
|
"edge_colors" : None
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ class Polygon(Mobject1D):
|
|||||||
|
|
||||||
|
|
||||||
class Grid(Mobject1D):
|
class Grid(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"height" : 6.0,
|
"height" : 6.0,
|
||||||
"width" : 6.0,
|
"width" : 6.0,
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ class Grid(Mobject1D):
|
|||||||
)
|
)
|
||||||
|
|
||||||
class Rectangle(Grid):
|
class Rectangle(Grid):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : YELLOW,
|
"color" : YELLOW,
|
||||||
"height" : 2.0,
|
"height" : 2.0,
|
||||||
"width" : 4.0,
|
"width" : 4.0,
|
||||||
@ -242,7 +242,7 @@ class Rectangle(Grid):
|
|||||||
])
|
])
|
||||||
|
|
||||||
class Square(Rectangle):
|
class Square(Rectangle):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"side_length" : 2.0,
|
"side_length" : 2.0,
|
||||||
}
|
}
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
@ -254,7 +254,7 @@ class Square(Rectangle):
|
|||||||
|
|
||||||
|
|
||||||
class FilledRectangle(Mobject1D):
|
class FilledRectangle(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : GREY,
|
"color" : GREY,
|
||||||
"height" : 2.0,
|
"height" : 2.0,
|
||||||
"width" : 4.0,
|
"width" : 4.0,
|
||||||
|
@ -5,7 +5,7 @@ from mobject.tex_mobject import TexMobject
|
|||||||
from scene import Scene
|
from scene import Scene
|
||||||
|
|
||||||
class NumberLine(Mobject1D):
|
class NumberLine(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : BLUE,
|
"color" : BLUE,
|
||||||
"numerical_radius" : SPACE_WIDTH,
|
"numerical_radius" : SPACE_WIDTH,
|
||||||
"unit_length_to_spatial_width" : 1,
|
"unit_length_to_spatial_width" : 1,
|
||||||
@ -101,7 +101,7 @@ class NumberLine(Mobject1D):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
class UnitInterval(NumberLine):
|
class UnitInterval(NumberLine):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"numerical_radius" : 0.5,
|
"numerical_radius" : 0.5,
|
||||||
"unit_length_to_spatial_width" : 2*(SPACE_WIDTH-1),
|
"unit_length_to_spatial_width" : 2*(SPACE_WIDTH-1),
|
||||||
"tick_frequency" : 0.1,
|
"tick_frequency" : 0.1,
|
||||||
@ -112,7 +112,7 @@ class UnitInterval(NumberLine):
|
|||||||
|
|
||||||
|
|
||||||
class NumberPlane(Mobject1D):
|
class NumberPlane(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : BLUE,
|
"color" : BLUE,
|
||||||
"x_radius" : SPACE_WIDTH,
|
"x_radius" : SPACE_WIDTH,
|
||||||
"y_radius" : SPACE_HEIGHT,
|
"y_radius" : SPACE_HEIGHT,
|
||||||
@ -216,7 +216,7 @@ class NumberPlane(Mobject1D):
|
|||||||
|
|
||||||
|
|
||||||
class XYZAxes(Mobject1D):
|
class XYZAxes(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : TEAL,
|
"color" : TEAL,
|
||||||
"radius" : SPACE_HEIGHT,
|
"radius" : SPACE_HEIGHT,
|
||||||
"tick_frequency" : 1,
|
"tick_frequency" : 1,
|
||||||
@ -233,7 +233,7 @@ class XYZAxes(Mobject1D):
|
|||||||
|
|
||||||
|
|
||||||
class SpaceGrid(Mobject1D):
|
class SpaceGrid(Mobject1D):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"color" : GREEN,
|
"color" : GREEN,
|
||||||
"radius" : SPACE_HEIGHT,
|
"radius" : SPACE_HEIGHT,
|
||||||
"unit_to_spatial_length" : 1,
|
"unit_to_spatial_length" : 1,
|
||||||
|
@ -7,7 +7,7 @@ from helpers import *
|
|||||||
|
|
||||||
|
|
||||||
class Stars(Mobject):
|
class Stars(Mobject):
|
||||||
DEFAULT_CONFIG = {
|
CONFIG = {
|
||||||
"point_thickness" : 1,
|
"point_thickness" : 1,
|
||||||
"radius" : SPACE_WIDTH,
|
"radius" : SPACE_WIDTH,
|
||||||
"num_points" : 1000,
|
"num_points" : 1000,
|
||||||
|
Reference in New Issue
Block a user