diff --git a/from_3b1b/active/bayes/part1.py b/from_3b1b/active/bayes/part1.py index 8939bc33..1a8c6c06 100644 --- a/from_3b1b/active/bayes/part1.py +++ b/from_3b1b/active/bayes/part1.py @@ -1697,7 +1697,7 @@ class ReasonByRepresentativeSample(CorrectViewOfFarmersAndLibrarians): "unit_size": 0.07, "tick_frequency": 10, }, - number_line_config={ + axis_config={ "include_tip": False, }, ) diff --git a/from_3b1b/active/diffyq/part1/pendulum.py b/from_3b1b/active/diffyq/part1/pendulum.py index ffc6dc2f..97cf34c7 100644 --- a/from_3b1b/active/diffyq/part1/pendulum.py +++ b/from_3b1b/active/diffyq/part1/pendulum.py @@ -254,7 +254,7 @@ class ThetaVsTAxes(Axes): "tick_frequency": PI / 8, "unit_size": 1.5, }, - "number_line_config": { + "axis_config": { "color": "#EEEEEE", "stroke_width": 2, "include_tip": False, @@ -371,7 +371,7 @@ class IntroducePendulum(PiCreatureScene, MovingCameraScene): "tip_length": 0.3, }, "x_max": 12, - "number_line_config": { + "axis_config": { "stroke_width": 2, } }, @@ -750,7 +750,7 @@ class LowAnglePendulum(Scene): "number_scale_val": 0.5, }, "x_max": 25, - "number_line_config": { + "axis_config": { "tip_length": 0.3, "stroke_width": 2, } @@ -837,7 +837,7 @@ class MediumAnglePendulum(LowAnglePendulum): "y_axis_config": {"unit_size": 0.75}, "y_max": PI / 2, "y_min": -PI / 2, - "number_line_config": { + "axis_config": { "tip_length": 0.3, "stroke_width": 2, } @@ -867,7 +867,7 @@ class HighAnglePendulum(LowAnglePendulum): "y_axis_config": {"unit_size": 0.5}, "y_max": PI, "y_min": -PI, - "number_line_config": { + "axis_config": { "tip_length": 0.3, "stroke_width": 2, } @@ -888,7 +888,7 @@ class VeryLowAnglePendulum(LowAnglePendulum): "y_axis_config": {"unit_size": 2}, "y_max": PI / 4, "y_min": -PI / 4, - "number_line_config": { + "axis_config": { "tip_length": 0.3, "stroke_width": 2, } diff --git a/from_3b1b/active/diffyq/part2/fourier_series.py b/from_3b1b/active/diffyq/part2/fourier_series.py index b734e7d3..8ca76b28 100644 --- a/from_3b1b/active/diffyq/part2/fourier_series.py +++ b/from_3b1b/active/diffyq/part2/fourier_series.py @@ -372,18 +372,18 @@ class FourierOfPiSymbol(FourierCirclesScene): return path -class FourierOfName(FourierOfPiSymbol, MovingCameraScene): +class FourierOfTexPaths(FourierOfPiSymbol, MovingCameraScene): CONFIG = { "n_vectors": 100, "name_color": WHITE, - "name_text": "Abc", + "animated_name": "Abc", "time_per_symbol": 5, "slow_factor": 1 / 5, "parametric_function_step_size": 0.01, } def construct(self): - name = TextMobject(self.name_text) + name = TextMobject(self.animated_name) max_width = FRAME_WIDTH - 2 max_height = FRAME_HEIGHT - 2 name.set_width(max_width) diff --git a/from_3b1b/active/diffyq/part2/staging.py b/from_3b1b/active/diffyq/part2/staging.py index 48d02d06..234ecd32 100644 --- a/from_3b1b/active/diffyq/part2/staging.py +++ b/from_3b1b/active/diffyq/part2/staging.py @@ -235,7 +235,7 @@ class BlackScholes(AltBrownianMotion): x_max=20, y_min=0, y_max=10, - number_line_config={ + axis_config={ "unit_size": 0.5, }, ) diff --git a/from_3b1b/active/diffyq/part3/staging.py b/from_3b1b/active/diffyq/part3/staging.py index baa5dad8..fc917a49 100644 --- a/from_3b1b/active/diffyq/part3/staging.py +++ b/from_3b1b/active/diffyq/part3/staging.py @@ -234,7 +234,7 @@ class FourierSeriesIllustraiton(Scene): CONFIG = { "n_range": range(1, 31, 2), "axes_config": { - "number_line_config": { + "axis_config": { "include_tip": False, }, "x_axis_config": { diff --git a/from_3b1b/old/borsuk_addition.py b/from_3b1b/old/borsuk_addition.py index 499d1d11..0c59f3ca 100644 --- a/from_3b1b/old/borsuk_addition.py +++ b/from_3b1b/old/borsuk_addition.py @@ -807,7 +807,7 @@ class FunctionGOutputSpace(FunctionGInputSpace): x_max=2.5, y_min=-2.5, y_max=2.5, - number_line_config={'unit_size': 1.5} + axis_config={'unit_size': 1.5} ) for axis in axes: numbers = list(range(-2, 3)) diff --git a/from_3b1b/old/clacks/question.py b/from_3b1b/old/clacks/question.py index 84491c5c..a3b61cb5 100644 --- a/from_3b1b/old/clacks/question.py +++ b/from_3b1b/old/clacks/question.py @@ -888,7 +888,7 @@ class PiComputingAlgorithmsAxes(Scene): y_min=0, x_max=9, y_max=5, - number_line_config={ + axis_config={ "tick_frequency": 100, "numbers_with_elongated_ticks": [], } diff --git a/from_3b1b/old/clacks/solution1.py b/from_3b1b/old/clacks/solution1.py index 010876f6..8751802c 100644 --- a/from_3b1b/old/clacks/solution1.py +++ b/from_3b1b/old/clacks/solution1.py @@ -633,7 +633,7 @@ class IntroduceVelocityPhaseSpace(AskAboutFindingNewVelocities): "x_min": -3.5, "x_max": 4, }, - "number_line_config": { + "axis_config": { "unit_size": 0.7, }, }, @@ -2612,7 +2612,7 @@ class UnitCircleIntuition(Scene): def draw_unit_circle(self): unit_size = 2.5 axes = Axes( - number_line_config={"unit_size": unit_size}, + axis_config={"unit_size": unit_size}, x_min=-2.5, x_max=2.5, y_min=-1.5, y_max=1.5, ) diff --git a/from_3b1b/old/div_curl.py b/from_3b1b/old/div_curl.py index 0c6a6148..90731ce2 100644 --- a/from_3b1b/old/div_curl.py +++ b/from_3b1b/old/div_curl.py @@ -2925,7 +2925,7 @@ class PhaseSpaceOfPopulationModel(ShowTwoPopulations, PiCreatureScene, MovingCam y_min=0, y_max=55, y_axis_config={"unit_size": 0.09}, - number_line_config={ + axis_config={ "tick_frequency": 10, }, ) diff --git a/from_3b1b/old/fourier.py b/from_3b1b/old/fourier.py index aae267d2..72427d08 100644 --- a/from_3b1b/old/fourier.py +++ b/from_3b1b/old/fourier.py @@ -190,7 +190,7 @@ class AddingPureFrequencies(PiCreatureScene): axes = Axes( y_min = -2, y_max = 2, x_min = 0, x_max = 10, - number_line_config = {"include_tip" : False}, + axis_config = {"include_tip" : False}, ) axes.stretch_to_fit_height(2) axes.to_corner(UP+LEFT) @@ -807,7 +807,7 @@ class FourierMachineScene(Scene): "y_unit_size" : 1, }, "frequency_axes_config" : { - "number_line_config" : { + "axis_config" : { "color" : TEAL, }, "x_min" : 0, @@ -3906,7 +3906,7 @@ class BoundsAtInfinity(SummarizeFormula): x_max = 140, y_min = -2, y_max = 2, - number_line_config = { + axis_config = { "include_tip" : False, }, ) diff --git a/from_3b1b/old/hyperdarts.py b/from_3b1b/old/hyperdarts.py index 1cef000a..23e76e7f 100644 --- a/from_3b1b/old/hyperdarts.py +++ b/from_3b1b/old/hyperdarts.py @@ -778,7 +778,7 @@ class ChooseXThenYUniformly(Scene): x_max=1.25, y_min=-1.25, y_max=1.25, - number_line_config={ + axis_config={ "tick_frequency": 0.25, "unit_size": unit_size, }, @@ -1527,7 +1527,7 @@ class TwoDPlusTwoDEqualsFourD(HyperdartScene): x_max=1.25, y_min=-1.25, y_max=1.25, - number_line_config={ + axis_config={ "unit_size": unit_size, "tick_frequency": 0.5, "include_tip": False, diff --git a/from_3b1b/old/name_animation.py b/from_3b1b/old/name_animation.py deleted file mode 100644 index 7114cabe..00000000 --- a/from_3b1b/old/name_animation.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- - - -from manimlib.imports import * - -NAME_WITH_SPACES = "Prime Meridian" -DIAMETER = 3.0 -RADIUS = DIAMETER / 2 -LETTER_SCALE = 1 - - -class NameAnimationScene(Scene): - CONFIG = { - "animated_name": "Prime Meridian" - } - - def construct(self): - name = self.animated_name - letter_mobs = TextMobject(name) - nb_letters = len(letter_mobs) - randy = PiCreature() - randy.move_to(ORIGIN).set_height(0.5 * DIAMETER) - randy.set_color(BLUE_E) - randy.look_at(UP + RIGHT) - self.add(randy) - dtheta = TAU / nb_letters - angles = np.arange(TAU / 4, -3 * TAU / 4, -dtheta) - name_mob = VGroup() - for (letter_mob, angle) in zip(letter_mobs, angles): - letter_mob.scale(LETTER_SCALE) - pos = RADIUS * np.cos(angle) * RIGHT + RADIUS * np.sin(angle) * UP - letter_mob.move_to(pos) - name_mob.add(letter_mob) - - pos2 = RADIUS * np.cos(angles[2]) * RIGHT + \ - RADIUS * np.sin(angles[2]) * UP - - times_n_label = VGroup( - TexMobject("\\times"), - Integer(1) - ) - times_n_label.arrange(RIGHT) - times_n_label.shift(FRAME_WIDTH * RIGHT / 4) - times_n_label.to_edge(UP) - - self.play( - LaggedStartMap(FadeIn, name_mob, run_time=3), - ApplyMethod(randy.change, "pondering", pos2, run_time=1), - FadeIn(times_n_label) - ) - - for n in range(2, nb_letters + 2): - - group = [] - - for (j, letter_mob) in enumerate(name_mob.submobjects): - - new_angle = TAU / 4 - n * j * dtheta - new_pos = RADIUS * np.cos(new_angle) * \ - RIGHT + RADIUS * np.sin(new_angle) * UP - letter_mob.target = letter_mob.copy().move_to(new_pos) - anim = MoveToTarget(letter_mob, path_arc=- j * dtheta) - group.append(anim) - new_n = Integer(n) - new_n.move_to(times_n_label[1]) - self.play( - AnimationGroup(*group, run_time=3), - UpdateFromFunc(randy, lambda r: r.look_at(name_mob.submobjects[2])), - FadeOut(times_n_label[1]), - FadeIn(new_n) - ) - times_n_label.submobjects[1] = new_n - self.wait(0.5) - - thank_you = TextMobject("Thank You!").next_to(randy, DOWN) - new_randy = randy.copy() - new_randy.change("hooray") - new_randy.set_color(BLUE_E) - new_randy.look_at(ORIGIN) - self.play( - ReplacementTransform(name_mob, VGroup(*thank_you)), - Transform(randy, new_randy) - ) - self.play(Blink(randy)) - - def __str__(self): - return self.animated_name.replace(" ", "") + "Animation" - - -names = [ - "Happy 18th Birthday\\\\Pranavi Hiremath!" -] - -if __name__ == "__main__": - for name in names: - try: - NameAnimationScene( - frame_duration=PRODUCTION_QUALITY_FRAME_DURATION, - camera_config=PRODUCTION_QUALITY_CAMERA_CONFIG, - animated_name=name, - write_to_movie=True, - output_directory=os.path.join( - VIDEO_DIR, - "active_projects", - "name_animations", - ), - ) - except Exception as e: - print("Could not animate %s: %s" % (name, e)) diff --git a/from_3b1b/old/quaternions.py b/from_3b1b/old/quaternions.py index e4567826..6d2a12db 100644 --- a/from_3b1b/old/quaternions.py +++ b/from_3b1b/old/quaternions.py @@ -3812,7 +3812,7 @@ class FelixViewOfProjection(TwoDStereographicProjection): def add_axes(self): axes = Axes( - number_line_config={ + axis_config={ "unit_size": 2, "color": WHITE, } @@ -4336,7 +4336,7 @@ class IntroduceQuaternions(Scene): class SimpleImaginaryQuaternionAxes(SpecialThreeDScene): def construct(self): self.three_d_axes_config.update({ - "number_line_config": {"unit_size": 2}, + "axis_config": {"unit_size": 2}, "x_min": -2, "x_max": 2, "y_min": -2, diff --git a/from_3b1b/old/sphere_area.py b/from_3b1b/old/sphere_area.py index 84150ae1..5d3c86a1 100644 --- a/from_3b1b/old/sphere_area.py +++ b/from_3b1b/old/sphere_area.py @@ -1458,7 +1458,7 @@ class JustifyHeightSquish(MovingCameraScene): def recreate_cross_section(self): axes = Axes( - number_line_config={ + axis_config={ "unit_size": 2, } ) diff --git a/from_3b1b/old/spirals.py b/from_3b1b/old/spirals.py index 76d2dc70..ed5b3cb9 100644 --- a/from_3b1b/old/spirals.py +++ b/from_3b1b/old/spirals.py @@ -58,7 +58,7 @@ def read_in_primes(max_N=None): class SpiralScene(MovingCameraScene): CONFIG = { "axes_config": { - "number_line_config": { + "axis_config": { "stroke_width": 1.5, } }, @@ -2897,7 +2897,7 @@ class ExplainRays(Explain44Spirals): "x_max": 1000, "y_min": -1000, "y_max": 1000, - "number_line_config": { + "axis_config": { "tick_frequency": 50, }, }, diff --git a/from_3b1b/on_hold/moduli.py b/from_3b1b/on_hold/moduli.py index e14242ca..7b79cdc9 100644 --- a/from_3b1b/on_hold/moduli.py +++ b/from_3b1b/on_hold/moduli.py @@ -401,7 +401,7 @@ class TriangleModuliSpace(Scene): x_max=1.5, y_min=-0.25, y_max=1.5, - number_line_config={ + axis_config={ "tick_frequency": 0.25, "unit_size": 3, } diff --git a/manimlib/mobject/coordinate_systems.py b/manimlib/mobject/coordinate_systems.py index 09c6adfa..4d3fc235 100644 --- a/manimlib/mobject/coordinate_systems.py +++ b/manimlib/mobject/coordinate_systems.py @@ -128,7 +128,7 @@ class CoordinateSystem(): class Axes(VGroup, CoordinateSystem): CONFIG = { - "number_line_config": { + "axis_config": { "color": LIGHT_GREY, "include_tip": True, "exclude_zero_from_default_numbers": True, @@ -158,7 +158,7 @@ class Axes(VGroup, CoordinateSystem): def create_axis(self, min_val, max_val, axis_config): new_config = merge_dicts_recursively( - self.number_line_config, + self.axis_config, {"x_min": min_val, "x_max": max_val}, axis_config, ) @@ -284,9 +284,7 @@ class NumberPlane(Axes): } def __init__(self, **kwargs): - digest_config(self, kwargs) - kwargs["number_line_config"] = self.axis_config - Axes.__init__(self, **kwargs) + super.__init__(**kwargs) self.init_background_lines() def init_background_lines(self): diff --git a/manimlib/mobject/svg/drawings.py b/manimlib/mobject/svg/drawings.py index f4374017..86625085 100644 --- a/manimlib/mobject/svg/drawings.py +++ b/manimlib/mobject/svg/drawings.py @@ -708,9 +708,10 @@ class Logo(VMobject): endpoint=False, ) radii[:2] = radii[1::-1] # Swap first two - radii[-1] = interpolate( - radii[-1], self.pupil_radius, 0.25 - ) + if self.n_spike_layers > 2: + radii[-1] = interpolate( + radii[-1], self.pupil_radius, 0.25 + ) for radius in radii: tip_angle = self.spike_angle diff --git a/manimlib/scene/scene_file_writer.py b/manimlib/scene/scene_file_writer.py index e2efd5e2..b67d97f3 100644 --- a/manimlib/scene/scene_file_writer.py +++ b/manimlib/scene/scene_file_writer.py @@ -34,6 +34,7 @@ class SceneFileWriter(object): # Previous output_file_name # TODO, address this in extract_scene et. al. "file_name": None, + "input_file_path": "", # ?? "output_directory": None, } diff --git a/manimlib/scene/three_d_scene.py b/manimlib/scene/three_d_scene.py index da120610..5c2be57f 100644 --- a/manimlib/scene/three_d_scene.py +++ b/manimlib/scene/three_d_scene.py @@ -109,7 +109,7 @@ class SpecialThreeDScene(ThreeDScene): }, "three_d_axes_config": { "num_axis_pieces": 1, - "number_line_config": { + "axis_config": { "unit_size": 2, "tick_frequency": 1, "numbers_with_elongated_ticks": [0, 1, 2], diff --git a/manimlib/scene/vector_space_scene.py b/manimlib/scene/vector_space_scene.py index 77a0228f..902ad3bd 100644 --- a/manimlib/scene/vector_space_scene.py +++ b/manimlib/scene/vector_space_scene.py @@ -290,7 +290,7 @@ class LinearTransformationScene(VectorScene): "axis_config": { "stroke_color": LIGHT_GREY, }, - "number_line_config": { + "axis_config": { "color": GREY, }, "background_line_style": {