Globally replace .points references with .get_points or .set_points depending on context

This commit is contained in:
Grant Sanderson 2021-01-12 16:07:45 -10:00
parent 831594be01
commit df6f3d2937
77 changed files with 359 additions and 380 deletions

View file

@ -331,7 +331,7 @@ class WalkingRandolph(GraphScene):
def construct(self):
GraphScene.construct(self)
point_path = [self.points[i] for i in self.path]
point_path = [self.get_points()[i] for i in self.path]
randy = Randolph()
randy.scale(RANDOLPH_SCALE_FACTOR)
randy.move_to(point_path[0])
@ -364,15 +364,15 @@ class PathExamples(GraphScene):
for path, non_path in zip(paths, non_paths):
path_lines = Mobject(*[
Line(
self.points[path[i]],
self.points[path[i+1]]
self.get_points()[path[i]],
self.get_points()[path[i+1]]
).set_color("yellow")
for i in range(len(path) - 1)
])
non_path_lines = Mobject(*[
Line(
self.points[pp[0]],
self.points[pp[1]],
self.get_points()[pp[0]],
self.get_points()[pp[1]],
).set_color("yellow")
for pp in non_path
])
@ -414,7 +414,7 @@ class IntroduceRandolph(GraphScene):
name = TextMobject("Randolph")
self.play(Transform(
randy,
deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR).move_to(self.points[0]),
deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR).move_to(self.get_points()[0]),
))
self.wait()
name.shift((0, 1, 0))
@ -425,7 +425,7 @@ class DefineSpanningTree(GraphScene):
def construct(self):
GraphScene.construct(self)
randy = Randolph()
randy.scale(RANDOLPH_SCALE_FACTOR).move_to(self.points[0])
randy.scale(RANDOLPH_SCALE_FACTOR).move_to(self.get_points()[0])
dollar_signs = TextMobject("\\$\\$")
dollar_signs.scale(EDGE_ANNOTATION_SCALE_FACTOR)
dollar_signs = Mobject(*[
@ -437,7 +437,7 @@ class DefineSpanningTree(GraphScene):
self.generate_spanning_tree()
def green_dot_at_index(index):
return Dot(
self.points[index],
self.get_points()[index],
radius = 2*Dot.DEFAULT_RADIUS,
color = "lightgreen",
)
@ -459,8 +459,8 @@ class DefineSpanningTree(GraphScene):
for pair in self.spanning_tree_index_pairs:
self.play(ShowCreation(
Line(
self.points[pair[0]],
self.points[pair[1]]
self.get_points()[pair[0]],
self.get_points()[pair[1]]
).set_color("yellow"),
run_time = run_time_per_branch
))
@ -472,7 +472,7 @@ class DefineSpanningTree(GraphScene):
unneeded_edges = list(filter(out_of_spanning_set, self.graph.edges))
for edge, limit in zip(unneeded_edges, list(range(5))):
line = Line(self.points[edge[0]], self.points[edge[1]])
line = Line(self.get_points()[edge[0]], self.get_points()[edge[1]])
line.set_color("red")
self.play(ShowCreation(line, run_time = 1.0))
self.add(unneeded.center().shift(line.get_center() + 0.2*UP))
@ -622,9 +622,9 @@ class ExamplesOfGraphs(GraphScene):
)).to_corner().shift(0.5*RIGHT).split()
horizontal_line = Line(
(-FRAME_X_RADIUS, FRAME_Y_RADIUS-1, 0),
(max(notions.points[:,0]), FRAME_Y_RADIUS-1, 0)
(max(notions.get_points()[:,0]), FRAME_Y_RADIUS-1, 0)
)
vert_line_x_val = min(notions.points[:,0]) - buff
vert_line_x_val = min(notions.get_points()[:,0]) - buff
vertical_line = Line(
(vert_line_x_val, FRAME_Y_RADIUS, 0),
(vert_line_x_val,-FRAME_Y_RADIUS, 0)
@ -701,7 +701,7 @@ class ExamplesOfGraphs(GraphScene):
not_connected = TextMobject("Not Connected")
not_connected.set_color("red")
for mob in connected, not_connected:
mob.shift(self.points[3] + UP)
mob.shift(self.get_points()[3] + UP)
self.play(*[
ShowCreation(mob, run_time = 1.0)
@ -836,7 +836,7 @@ class ListOfCorrespondances(Scene):
this_arrow = deepcopy(arrow)
for mob in left, right, this_arrow:
mob.shift(height*UP)
arrow_xs = this_arrow.points[:,0]
arrow_xs = this_arrow.get_points()[:,0]
left.to_edge(RIGHT)
left.shift((min(arrow_xs) - FRAME_X_RADIUS, 0, 0))
right.to_edge(LEFT)
@ -863,15 +863,15 @@ class CyclesCorrespondWithConnectedComponents(GraphScene):
enclosed_vertices = [0, 1]
randy = Randolph()
randy.scale(RANDOLPH_SCALE_FACTOR)
randy.move_to(self.points[cycle[0]])
randy.move_to(self.get_points()[cycle[0]])
lines_to_remove = []
for last, next in zip(cycle, cycle[1:]):
line = Line(self.points[last], self.points[next])
line = Line(self.get_points()[last], self.get_points()[next])
line.set_color("yellow")
self.play(
ShowCreation(line),
WalkPiCreature(randy, self.points[next]),
WalkPiCreature(randy, self.get_points()[next]),
run_time = 1.0
)
lines_to_remove.append(line)
@ -911,7 +911,7 @@ class IntroduceMortimer(GraphScene):
randy_path = (0, 1, 3)
morty_path = (-2, -3, -4)
morty_crossed_lines = [
Line(self.points[i], self.points[j]).set_color("red")
Line(self.get_points()[i], self.get_points()[j]).set_color("red")
for i, j in [(7, 1), (1, 5)]
]
kwargs = {"run_time" : 1.0}
@ -924,7 +924,7 @@ class IntroduceMortimer(GraphScene):
self.remove(name)
small_randy = deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR)
small_morty = deepcopy(morty).scale(RANDOLPH_SCALE_FACTOR)
small_randy.move_to(self.points[randy_path[0]])
small_randy.move_to(self.get_points()[randy_path[0]])
small_morty.move_to(self.dual_points[morty_path[0]])
self.play(*[
FadeIn(mob)
@ -942,10 +942,10 @@ class IntroduceMortimer(GraphScene):
self.set_color_region(self.regions[next])
self.wait()
for last, next in zip(randy_path, randy_path[1:]):
line = Line(self.points[last], self.points[next])
line = Line(self.get_points()[last], self.get_points()[next])
line.set_color("yellow")
self.play(
WalkPiCreature(randy, self.points[next]),
WalkPiCreature(randy, self.get_points()[next]),
ShowCreation(line),
**kwargs
)
@ -969,7 +969,7 @@ class RandolphMortimerSpanningTreeGame(GraphScene):
self.generate_regions()
randy = Randolph().scale(RANDOLPH_SCALE_FACTOR)
morty = Mortimer().scale(RANDOLPH_SCALE_FACTOR)
randy.move_to(self.points[0])
randy.move_to(self.get_points()[0])
morty.move_to(self.dual_points[0])
attempted_dual_point_index = 2
region_ordering = [0, 1, 7, 2, 3, 5, 4, 6]
@ -1005,7 +1005,7 @@ class RandolphMortimerSpanningTreeGame(GraphScene):
cycle = self.graph.region_cycles[cycle_index]
self.set_color_region(self.regions[cycle_index], "black")
self.play(ShowCreation(Mobject(*[
Line(self.points[last], self.points[next]).set_color("green")
Line(self.get_points()[last], self.get_points()[next]).set_color("green")
for last, next in zip(cycle, list(cycle)[1:] + [cycle[0]])
])))
self.wait()
@ -1092,7 +1092,7 @@ class DualSpanningTree(GraphScene):
self.generate_spanning_tree()
randy = Randolph()
randy.scale(RANDOLPH_SCALE_FACTOR)
randy.move_to(self.points[0])
randy.move_to(self.get_points()[0])
morty = Mortimer()
morty.scale(RANDOLPH_SCALE_FACTOR)
morty.move_to(self.dual_points[0])
@ -1119,14 +1119,14 @@ class TreeCountFormula(Scene):
gs.generate_treeified_spanning_tree()
branches = gs.treeified_spanning_tree.to_edge(LEFT).split()
all_dots = [Dot(branches[0].points[0])]
all_dots = [Dot(branches[0].get_points()[0])]
self.add(text, all_dots[0])
for branch in branches:
self.play(
ShowCreation(branch),
run_time = time_per_branch
)
dot = Dot(branch.points[-1])
dot = Dot(branch.get_points()[-1])
self.add(dot)
all_dots.append(dot)
self.wait()

View file

@ -80,7 +80,7 @@ def convergent_sum():
def Underbrace(left, right):
result = TexMobject("\\Underbrace{%s}"%(14*"\\quad"))
result.stretch_to_fit_width(right[0]-left[0])
result.shift(left - result.points[0])
result.shift(left - result.get_points()[0])
return result
def zero_to_one_interval():
@ -154,14 +154,14 @@ class IntroduceDivergentSum(Scene):
equation[0].get_boundary_point(DOWN+LEFT),
equation[1].get_boundary_point(DOWN+RIGHT)
).shift(0.2*DOWN)
min_x_coord = min(equation[0].points[:,0])
min_x_coord = min(equation[0].get_points()[:,0])
for x in range(NUM_WRITTEN_TERMS):
self.add(equation[x])
if x == 0:
self.wait(0.75)
continue
brace.stretch_to_fit_width(
max(equation[x].points[:,0]) - min_x_coord
max(equation[x].get_points()[:,0]) - min_x_coord
)
brace.to_edge(LEFT, buff = FRAME_X_RADIUS+min_x_coord)
if sum_value:
@ -175,7 +175,7 @@ class IntroduceDivergentSum(Scene):
*[equation[NUM_WRITTEN_TERMS + i] for i in range(3)]
)
end_brace = deepcopy(brace).stretch_to_fit_width(
max(ellipses.points[:,0])-min_x_coord
max(ellipses.get_points()[:,0])-min_x_coord
).to_edge(LEFT, buff = FRAME_X_RADIUS+min_x_coord)
kwargs = {"run_time" : 5.0, "rate_func" : rush_into}
flip_through = FlipThroughNumbers(
@ -209,7 +209,7 @@ class ClearlyNonsense(Scene):
)
right_arrow = Arrow(
(FRAME_X_RADIUS-0.5)*RIGHT + DOWN,
tail = (max(this_way.points[:,0]), -1, 0)
tail = (max(this_way.get_points()[:,0]), -1, 0)
)
how_here.set_color("red")
neg_1_arrow.set_color("red")
@ -418,7 +418,7 @@ class DotsGettingCloser(Scene):
self.add(*dots)
self.wait()
for x in range(10):
distance = min(dots[1].points[:,0])-max(dots[0].points[:,0])
distance = min(dots[1].get_points()[:,0])-max(dots[0].get_points()[:,0])
self.play(ApplyMethod(dots[0].shift, 0.5*distance*RIGHT))
@ -757,7 +757,7 @@ class CircleZoomInOnOne(Scene):
])
self.wait()
for num in numbers[1:] + [text]:
curr_num.points = np.array(list(reversed(curr_num.points)))
curr_num.set_points(list(reversed(curr_num.get_points())))
self.play(
ShowCreation(
curr_num,
@ -847,8 +847,8 @@ class DefineInfiniteSum(Scene):
lambda mob : mob.scale(0.5).to_corner(UP+LEFT, buff = buff),
expression
))
bottom = (min(expression.points[:,1]) - buff)*UP
side = (max(expression.points[:,0]) + buff)*RIGHT
bottom = (min(expression.get_points()[:,1]) - buff)*UP
side = (max(expression.get_points()[:,0]) + buff)*RIGHT
lines = [
Line(FRAME_X_RADIUS*LEFT+bottom, side+bottom),
Line(FRAME_Y_RADIUS*UP+side, side+bottom)
@ -873,7 +873,7 @@ class DefineInfiniteSum(Scene):
number_line = NumberLine()
ex_point = 2*RIGHT
ex = TexMobject("X").shift(ex_point + LEFT + UP)
arrow = Arrow(ex_point, tail = ex.points[-1]).nudge()
arrow = Arrow(ex_point, tail = ex.get_points()[-1]).nudge()
for term, count in zip(terms, it.count()):
self.add(term)
@ -954,7 +954,7 @@ class SeekMoreGeneralTruths(Scene):
for summand in summands
], size = "")
sums.stretch_to_fit_height(FRAME_HEIGHT-1)
sums.shift((FRAME_Y_RADIUS-0.5-max(sums.points[:,1]))*UP)
sums.shift((FRAME_Y_RADIUS-0.5-max(sums.get_points()[:,1]))*UP)
for qsum in sums.split():
qsum.sort_points(lambda p : np.dot(p, DOWN+RIGHT))
@ -1017,7 +1017,7 @@ class ChopIntervalInProportions(Scene):
brace.get_center()+0.3*UP,
tail = term.get_center()+0.5*DOWN
)
arrow.points = np.array(list(reversed(arrow.points)))
arrow.set_points(list(reversed(arrow.get_points()))
additional_anims = [ShowCreation(arrow)]
if brace_to_replace is not None:
if mode == "p":
@ -2025,7 +2025,7 @@ class PAdicMetric(Scene):
),
DelayByOrder(Transform(
start,
Point(arrow.points[0]).set_color("white")
Point(arrow.get_points()[0]).set_color("white")
))
)
self.play(ShimmerIn(end))

View file

@ -232,7 +232,7 @@ class ShowMatrixTransform(TransformScene2D):
if show_matrix:
self.add(matrix_mobject(matrix).to_corner(UP+LEFT))
def func(mobject):
mobject.points[:, :2] = np.dot(mobject.points[:, :2], np.transpose(matrix))
mobject.get_points()[:, :2] = np.dot(mobject.get_points()[:, :2], np.transpose(matrix))
return mobject
self.wait()
@ -251,7 +251,7 @@ class ShowMatrixTransform(TransformScene2D):
)
arrow.remove_tip()
new_arrow.remove_tip()
Mobject.align_data(arrow, new_arrow)
Mobject.align_data_and_family(arrow, new_arrow)
arrow.add_tip()
new_arrow.add_tip()
anims.append(Transform(arrow, new_arrow, **kwargs))
@ -471,7 +471,7 @@ class ShowMatrixTransformWithDot(TransformScene2D):
if show_matrix:
self.add(matrix_mobject(matrix).to_corner(UP+LEFT))
def func(mobject):
mobject.points[:, :2] = np.dot(mobject.points[:, :2], np.transpose(matrix))
mobject.get_points()[:, :2] = np.dot(mobject.get_points()[:, :2], np.transpose(matrix))
return mobject
dot = Dot((-1, 2, 0), color = "yellow")
self.add(dot)
@ -500,7 +500,7 @@ class ShowMatrixTransformWithDot(TransformScene2D):
)
arrow.remove_tip()
new_arrow.remove_tip()
Mobject.align_data(arrow, new_arrow)
Mobject.align_data_and_family(arrow, new_arrow)
arrow.add_tip()
new_arrow.add_tip()
anims.append(Transform(arrow, new_arrow, **kwargs))

View file

@ -87,7 +87,7 @@ class CircleScene(Scene):
self.circle_pieces = []
self.smaller_circle_pieces = []
for i in range(len(self.points)):
pp = self.points[i], self.points[(i+1)%len(self.points)]
pp = self.get_points()[i], self.get_points()[(i+1)%len(self.points)]
transform = np.array([
[pp[0][0], pp[1][0], 0],
[pp[0][1], pp[1][1], 0],
@ -148,7 +148,7 @@ class MoserPattern(CircleScene):
self.add(n_equals)
for n in range(1, len(radians)+1):
self.add(*self.dots[:n])
self.add(*[Line(p[0], p[1]) for p in it.combinations(self.points[:n], 2)])
self.add(*[Line(p[0], p[1]) for p in it.combinations(self.get_points()[:n], 2)])
tex_stuffs = [
TexMobject(str(moser_function(n))),
TexMobject(str(n)).shift(num.get_center())
@ -357,7 +357,7 @@ class NonGeneralPosition(CircleScene):
center_region = reduce(
Region.intersect,
[
HalfPlane((self.points[x], self.points[(x+3)%6]))
HalfPlane((self.get_points()[x], self.get_points()[(x+3)%6]))
for x in [0, 4, 2]#Ya know, trust it
]
)
@ -421,7 +421,7 @@ class GeneralPositionRule(Scene):
intersecting_lines = [
line.scale(0.3).set_color()
for i, j in pairs
for line in [Line(cs.points[i], cs.points[j])]
for line in [Line(cs.get_points()[i], cs.get_points()[j])]
]
self.play(*[
ShowCreation(line, run_time = 1.0)
@ -558,8 +558,8 @@ class IntersectionPointCorrespondances(CircleScene):
indices.sort()
CircleScene.__init__(self, radians, *args, **kwargs)
intersection_point = intersection(
(self.points[indices[0]], self.points[indices[2]]),
(self.points[indices[1]], self.points[indices[3]])
(self.get_points()[indices[0]], self.get_points()[indices[2]]),
(self.get_points()[indices[1]], self.get_points()[indices[3]])
)
if len(intersection_point) == 2:
intersection_point = list(intersection_point) + [0]
@ -620,8 +620,8 @@ class LinesIntersectOutside(CircleScene):
indices.sort()
CircleScene.__init__(self, radians, *args, **kwargs)
intersection_point = intersection(
(self.points[indices[0]], self.points[indices[1]]),
(self.points[indices[2]], self.points[indices[3]])
(self.get_points()[indices[0]], self.get_points()[indices[1]]),
(self.get_points()[indices[2]], self.get_points()[indices[3]])
)
intersection_point = tuple(list(intersection_point) + [0])
intersection_dot = Dot(intersection_point)
@ -636,8 +636,8 @@ class LinesIntersectOutside(CircleScene):
])
self.play(*[
Transform(
Line(self.points[indices[p0]], self.points[indices[p1]]),
Line(self.points[indices[p0]], intersection_point))
Line(self.get_points()[indices[p0]], self.get_points()[indices[p1]]),
Line(self.get_points()[indices[p0]], intersection_point))
for p0, p1 in [(0, 1), (3, 2)]
] + [ShowCreation(intersection_dot)])
@ -648,8 +648,8 @@ class QuadrupletsToIntersections(CircleScene):
frame_time = 1.0
for quad in quadruplets:
intersection_dot = Dot(intersection(
(self.points[quad[0]], self.points[quad[2]]),
(self.points[quad[1]], self.points[quad[3]])
(self.get_points()[quad[0]], self.get_points()[quad[2]]),
(self.get_points()[quad[1]], self.get_points()[quad[3]])
)).repeat(3)
dot_quad = [deepcopy(self.dots[i]) for i in quad]
for dot in dot_quad:
@ -736,8 +736,8 @@ class IntersectCubeGraphEdges(GraphScene):
self.remove(self.edges[0], self.edges[4])
self.play(*[
Transform(
Line(self.points[i], self.points[j]),
CurvedLine(self.points[i], self.points[j]),
Line(self.get_points()[i], self.get_points()[j]),
CurvedLine(self.get_points()[i], self.get_points()[j]),
)
for i, j in [(0, 1), (5, 4)]
])
@ -939,14 +939,14 @@ class HowIntersectionChopsLine(CircleScene):
indices.sort()
CircleScene.__init__(self, radians, *args, **kwargs)
intersection_point = intersection(
(self.points[indices[0]], self.points[indices[2]]),
(self.points[indices[1]], self.points[indices[3]])
(self.get_points()[indices[0]], self.get_points()[indices[2]]),
(self.get_points()[indices[1]], self.get_points()[indices[3]])
)
if len(intersection_point) == 2:
intersection_point = list(intersection_point) + [0]
pairs = list(it.combinations(list(range(len(radians))), 2))
lines = [
Line(self.points[indices[p0]], self.points[indices[p1]])
Line(self.get_points()[indices[p0]], self.get_points()[indices[p1]])
for p0, p1 in [(2, 0), (1, 3)]
]
self.remove(*[

View file

@ -113,8 +113,8 @@ class Piano(ImageMobject):
x0 = left + count*self.ivory_jump
x1 = x0 + self.ivory_jump
key.add_points(
self.points[
(self.points[:,0] > x0)*(self.points[:,0] < x1)
self.get_points()[
(self.get_points()[:,0] > x0)*(self.get_points()[:,0] < x1)
]
)
keys.append(key)
@ -534,7 +534,7 @@ class FlashOnXProximity(Animation):
def interpolate_mobject(self, alpha):
for mob in self.close_mobjects:
if np.min(np.abs(mob.points[:,0] - self.x_val)) < 0.1:
if np.min(np.abs(mob.get_points()[:,0] - self.x_val)) < 0.1:
self.mobject.set_color()
return
self.mobject.to_original_color()

View file

@ -315,7 +315,7 @@ class TauPoem(Scene):
Transform(pi.left_leg, tau.leg),
Transform(
pi.right_leg,
Point(pi.right_leg.points[0,:]).set_color("black")
Point(pi.right_leg.get_points()[0,:]).set_color("black")
),
Transform(pi.mouth, tau.mouth),
CounterclockwiseTransform(
@ -327,7 +327,7 @@ class TauPoem(Scene):
def line9(self):
tau = TauCreature()
pi = PiCreature().set_color("red").give_straight_face()
pi.scale(0.2).move_to(tau.arm.points[-1,:])
pi.scale(0.2).move_to(tau.arm.get_points()[-1,:])
point = Point(pi.get_center()).set_color("black")
vanish_local = 3*(LEFT + UP)
new_pi = deepcopy(pi)

View file

@ -73,26 +73,26 @@ class SlideWordDownCycloid(Animation):
if time < cut_offs[0]:
brightness = time/cut_offs[0]
letter.rgbas = brightness*np.ones(letter.rgbas.shape)
position = self.path.points[0]
position = self.path.get_points()[0]
angle = 0
elif time < cut_offs[1]:
alpha = (time-cut_offs[0])/(cut_offs[1]-cut_offs[0])
angle = -rush_into(alpha)*np.pi/2
position = self.path.points[0]
position = self.path.get_points()[0]
elif time < cut_offs[2]:
alpha = (time-cut_offs[1])/(cut_offs[2]-cut_offs[1])
index = int(alpha*self.path.get_num_points())
position = self.path.points[index]
position = self.path.get_points()[index]
try:
angle = angle_of_vector(
self.path.points[index+1] - \
self.path.points[index]
self.path.get_points()[index+1] - \
self.path.get_points()[index]
)
except:
angle = letter.angle
else:
alpha = (time-cut_offs[2])/(1-cut_offs[2])
start = self.path.points[-1]
start = self.path.get_points()[-1]
end = end_letter.get_bottom()
position = interpolate(start, end, rush_from(alpha))
angle = 0
@ -206,8 +206,8 @@ class PathSlidingScene(Scene):
def add_cycloid_end_points(self):
cycloid = Cycloid()
point_a = Dot(cycloid.points[0])
point_b = Dot(cycloid.points[-1])
point_a = Dot(cycloid.get_points()[0])
point_b = Dot(cycloid.get_points()[-1])
A = TexMobject("A").next_to(point_a, LEFT)
B = TexMobject("B").next_to(point_b, RIGHT)
self.add(point_a, point_b, A, B)
@ -221,8 +221,8 @@ class TryManyPaths(PathSlidingScene):
self.slider = randy.copy()
randy.scale(RANDY_SCALE_FACTOR)
paths = self.get_paths()
point_a = Dot(paths[0].points[0])
point_b = Dot(paths[0].points[-1])
point_a = Dot(paths[0].get_points()[0])
point_b = Dot(paths[0].get_points()[-1])
A = TexMobject("A").next_to(point_a, LEFT)
B = TexMobject("B").next_to(point_b, RIGHT)
for point, tex in [(point_a, A), (point_b, B)]:
@ -288,8 +288,8 @@ class TryManyPaths(PathSlidingScene):
return paths + [cycloid]
def align_paths(self, paths, target_path):
start = target_path.points[0]
end = target_path.points[-1]
start = target_path.get_points()[0]
end = target_path.get_points()[-1]
for path in paths:
path.put_start_and_end_on(start, end)
@ -312,7 +312,7 @@ class NotTheCircle(PathSlidingScene):
angle = 2*np.pi/3
path = Arc(angle, radius = 3)
path.set_color_by_gradient(RED_D, WHITE)
radius = Line(ORIGIN, path.points[0])
radius = Line(ORIGIN, path.get_points()[0])
randy = Randolph()
randy.scale(RANDY_SCALE_FACTOR)
randy.shift(-randy.get_bottom())
@ -582,8 +582,8 @@ class ThetaTInsteadOfXY(Scene):
def construct(self):
cycloid = Cycloid()
index = cycloid.get_num_points()/3
point = cycloid.points[index]
vect = cycloid.points[index+1]-point
point = cycloid.get_points()[index]
vect = cycloid.get_points()[index+1]-point
vect /= get_norm(vect)
vect *= 3
vect_mob = Vector(point, vect)

View file

@ -63,7 +63,7 @@ class CycloidScene(Scene):
self.play(
RollAlongVector(
self.circle,
self.cycloid.points[-1]-self.cycloid.points[0],
self.cycloid.get_points()[-1]-self.cycloid.get_points()[0],
**kwargs
),
ShowCreation(self.cycloid, **kwargs),
@ -75,7 +75,7 @@ class CycloidScene(Scene):
self.play(
RollAlongVector(
self.circle,
self.cycloid.points[0]-self.cycloid.points[- 1],
self.cycloid.get_points()[0]-self.cycloid.get_points()[- 1],
rotation_vector = IN,
**kwargs
),
@ -136,7 +136,7 @@ class IntroduceCycloid(CycloidScene):
q_marks, arrows = result = [Mobject(), Mobject()]
for x in range(n_marks):
index = (x+0.5)*self.cycloid.get_num_points()/n_marks
q_point = self.cycloid.points[index]
q_point = self.cycloid.get_points()[index]
vect = q_point-mob.get_center()
start_point = circle.get_boundary_point(vect)
arrow = Arrow(
@ -178,7 +178,7 @@ class LeviSolution(CycloidScene):
def init_points(self):
index = int(self.cycloid_fraction*self.cycloid.get_num_points())
p_point = self.cycloid.points[index]
p_point = self.cycloid.get_points()[index]
p_dot = Dot(p_point)
p_label = TexMobject("P")
p_label.next_to(p_dot, DOWN+LEFT)
@ -557,7 +557,7 @@ class SlidingObject(CycloidScene, PathSlidingScene):
end_time,
RollAlongVector(
self.circle,
self.cycloid.points[-1]-self.cycloid.points[0],
self.cycloid.get_points()[-1]-self.cycloid.get_points()[0],
run_time = end_time-start_time,
rate_func=linear
)

View file

@ -46,7 +46,7 @@ def sort_by_color(mob):
mob.rgbas
))
mob.rgbas = mob.rgbas[indices]
mob.points = mob.points[indices]
mob.points = mob.get_points()[indices]
@ -84,10 +84,10 @@ def nearest_neighbor_align(mobject1, mobject2):
for n in range(mobject1.get_num_points()):
indices = (closest_point_indices == n)
new_mob1.add_points(
[mobject1.points[n]]*sum(indices)
[mobject1.get_points()[n]]*sum(indices)
)
new_mob2.add_points(
mobject2.points[indices],
mobject2.get_points()[indices],
rgbas = mobject2.rgbas[indices]
)
return new_mob1, new_mob2

View file

@ -306,8 +306,8 @@ class MultilayeredGlass(PhotonScene, ZoomedScene):
0, self.cycloid.get_num_points()-1, 10
)
for index in indices:
point = self.cycloid.points[index]
next_point = self.cycloid.points[index+1]
point = self.cycloid.get_points()[index]
next_point = self.cycloid.get_points()[index+1]
angle = angle_of_vector(point - next_point)
for mob in little_square, line:
mob.shift(point - mob.get_center())

View file

@ -29,7 +29,7 @@ class PhotonScene(Scene):
def wavify(self, mobject):
result = mobject.copy()
result.ingest_submobjects()
tangent_vectors = result.points[1:]-result.points[:-1]
tangent_vectors = result.get_points()[1:]-result.get_points()[:-1]
lengths = np.apply_along_axis(
get_norm, 1, tangent_vectors
)
@ -42,7 +42,7 @@ class PhotonScene(Scene):
nudge_sizes = 0.1*np.sin(2*np.pi*times)
thick_nudge_sizes = nudge_sizes.repeat(3).reshape((len(nudge_sizes), 3))
nudges = thick_nudge_sizes*normal_vectors
result.points[1:] += nudges
result.get_points()[1:] += nudges
return result
@ -292,7 +292,7 @@ class ShowMultiplePathsInWater(ShowMultiplePathsScene):
straight = Line(self.start_point, self.end_point)
slow = TextMobject("Slow")
slow.rotate(np.arctan(straight.get_slope()))
slow.shift(straight.points[int(0.7*straight.get_num_points())])
slow.shift(straight.get_points()[int(0.7*straight.get_num_points())])
slow.shift(0.5*DOWN)
too_long = TextMobject("Too long")
too_long.shift(UP)
@ -367,7 +367,7 @@ class StraightLinesFastestInConstantMedium(PhotonScene):
end = 2*np.pi
)
squaggle.shift(2*UP)
start, end = squaggle.points[0], squaggle.points[-1]
start, end = squaggle.get_points()[0], squaggle.get_points()[-1]
line = Line(start, end)
result = [squaggle, line]
for mob in result:
@ -465,12 +465,12 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater):
top_dist.scale(0.5)
a = 0.3
n = top_line.get_num_points()
point = top_line.points[int(a*n)]
point = top_line.get_points()[int(a*n)]
top_dist.next_to(Point(point), RIGHT, buff = 0.3)
bottom_dist = TexMobject("\\sqrt{h_2^2+(w-x)^2}")
bottom_dist.scale(0.5)
n = bottom_line.get_num_points()
point = bottom_line.points[int((1-a)*n)]
point = bottom_line.get_points()[int((1-a)*n)]
bottom_dist.next_to(Point(point), LEFT, buff = 1)
end_top_line = Line(self.start_point, end_x)
@ -494,7 +494,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater):
axes, UP
))
new_graph = graph.copy()
midpoint = new_graph.points[new_graph.get_num_points()/2]
midpoint = new_graph.get_points()[new_graph.get_num_points()/2]
new_graph.filter_out(lambda p : p[0] < midpoint[0])
new_graph.reverse_points()
pairs_for_end_transform = [
@ -549,7 +549,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater):
step = self.frame_duration/run_time
for a in smooth(np.arange(0, 1-step, step)):
index = int(a*graph.get_num_points())
p1, p2 = graph.points[index], graph.points[index+1]
p1, p2 = graph.get_points()[index], graph.get_points()[index+1]
line = Line(LEFT, RIGHT)
line.rotate(angle_of_vector(p2-p1))
line.shift(p1)
@ -666,7 +666,7 @@ class SpringSetup(ShowMultiplePathsInWater):
circle = Circle(color = next(colors))
circle.reverse_points()
circle.scale(spring.loop_radius)
circle.shift(spring.points[0])
circle.shift(spring.get_points()[0])
self.play(Transform(circle, spring))
self.remove(circle)

View file

@ -230,7 +230,7 @@ class ThetaTGraph(Scene):
graph = ParametricCurve(
lambda t : 4*t*RIGHT + 2*smooth(t)*UP
)
line = Line(graph.points[0], graph.points[-1], color = WHITE)
line = Line(graph.get_points()[0], graph.get_points()[-1], color = WHITE)
q_mark = TextMobject("?")
q_mark.next_to(Point(graph.get_center()), LEFT)
stars = Stars(color = BLACK)
@ -384,7 +384,7 @@ class ShortestPathProblem(Scene):
end = 2*np.pi
)
path.scale(6/(2*np.pi))
path.shift(point_a - path.points[0])
path.shift(point_a - path.get_points()[0])
path.set_color(RED)
line = Line(point_a, point_b)
words = TextMobject("Shortest path from $A$ to $B$")

View file

@ -421,7 +421,7 @@ class ContinuouslyObeyingSnellsLaw(MultilayeredScene):
def show_equation(self, chopped_cycloid, ref_mob):
point2, point1 = chopped_cycloid.points[-2:]
point2, point1 = chopped_cycloid.get_points()[-2:]
arc, theta, vert_line, tangent_line = self.get_marks(
point1, point2
)

View file

@ -19,7 +19,7 @@ class FractalCreation(Scene):
order = order,
**self.fractal_kwargs
)
fractal.align_data(new_fractal)
fractal.align_data_and_family(new_fractal)
self.play(Transform(
fractal, new_fractal,
**self.transform_kwargs

View file

@ -1172,7 +1172,7 @@ class BinaryCountingAtEveryScale(Scene):
], run_time = 1)
for bit_mob in bit_mobs:
curr_bits.align_data(bit_mob)
curr_bits.align_data_and_family(bit_mob)
bit_mob.set_color(YELLOW)
bit_mob[0].set_color(MAROON_B)
self.play(get_run_through(bit_mobs[1:2**(self.num_bits-1)]))
@ -1359,7 +1359,7 @@ class IntroduceSolveByCounting(TowersOfHanoiScene):
self.curr_bit_mob = next(self.bit_mobs_iter)
for bit_mob in bit_mobs:
bit_mob.align_data(self.curr_bit_mob)
bit_mob.align_data_and_family(self.curr_bit_mob)
for bit, disk in zip(bit_mob, reversed(list(self.disks))):
bit.set_color(disk.get_color())
bit_mobs.next_to(self.peg_labels, DOWN)
@ -2431,7 +2431,7 @@ class TernaryCountingSelfSimilarPattern(Scene):
curr_ternary_mob = next(ternary_mob_iter)
for trits in ternary_mobs:
trits.align_data(curr_ternary_mob)
trits.align_data_and_family(curr_ternary_mob)
for trit, color in zip(trits, colors):
trit.set_color(color)
def get_increment():
@ -2488,7 +2488,7 @@ class SolveConstrainedWithTernaryCounting(ConstrainedTowersOfHanoiScene):
ternary_mobs.next_to(self.peg_labels, DOWN)
for trits in ternary_mobs:
trits.align_data(ternary_mobs[0])
trits.align_data_and_family(ternary_mobs[0])
trits.set_color_by_gradient(*self.disk_start_and_end_colors)
self.ternary_mob_iter = it.cycle(ternary_mobs)
self.curr_ternary_mob = self.ternary_mob_iter.next().copy()

View file

@ -235,7 +235,7 @@ class FromKochToSpaceFilling(Scene):
2*(np.pi/2 - curve.angle),
radius = r,
start_angle = np.pi+curve.angle
).shift(curve.points[curve.get_num_points()/2])
).shift(curve.get_points()[curve.get_num_points()/2])
for curve, r in zip(curves, [0.6, 0.7, 0.4])
]
theta = TexMobject("\\theta")

View file

@ -489,7 +489,7 @@ class RandomMapping(Scene):
# for mob in grid, freq_line:
# indices = np.arange(mob.get_num_points())
# random.shuffle(indices)
# mob.points = mob.points[indices]
# mob.points = mob.get_points()[indices]
stars = Stars(stroke_width = grid.stroke_width)
self.add(grid)
@ -615,7 +615,7 @@ class WeaveLineThroughPixels(Scene):
fraction_along_curve = index_along_curve/float(curve.get_num_points())
target = square.copy().center().scale(0.8/(2**order))
line_index = int(fraction_along_curve*line.get_num_points())
target.shift(line.points[line_index])
target.shift(line.get_points()[line_index])
targets.add(target)
@ -766,7 +766,7 @@ class Order2PseudoHilbertCurve(Scene):
last_curve = mini_curves[0]
naive_curve = Mobject(last_curve)
for mini_curve in mini_curves[1:]:
line = Line(last_curve.points[-1], mini_curve.points[0])
line = Line(last_curve.get_points()[-1], mini_curve.get_points()[0])
naive_curve.add(line, mini_curve)
last_curve = mini_curve
naive_curve.ingest_submobjects()
@ -986,7 +986,7 @@ class IncreasingResolutionWithSnakeCurve(Scene):
start_dots, end_dots = [
Mobject(*[
Dot(
curve.points[int(x*curve.get_num_points())],
curve.get_points()[int(x*curve.get_num_points())],
color = color
)
for x, color in [
@ -1024,7 +1024,7 @@ class TrackSpecificCurvePoint(Scene):
dot = Dot(UP)
start_dot = Dot(0.1*LEFT)
dots = [
Dot(curve.points[alpha*curve.get_num_points()])
Dot(curve.get_points()[alpha*curve.get_num_points()])
for curve in curves
]

View file

@ -50,7 +50,7 @@ class HilbertCurveIsPerfect(Scene):
)
colored_curve.rgbas = sparce_lion.rgbas[closest_point_indices]
line = Line(5*LEFT, 5*RIGHT)
Mobject.align_data(line, colored_curve)
Mobject.align_data_and_family(line, colored_curve)
line.rgbas = colored_curve.rgbas
self.add(lion)
@ -246,7 +246,7 @@ class DefinitionOfCurve(Scene):
fine_curve.replace(curve)
dots = Mobject(*[
Dot(
curve.points[n*curve.get_num_points()/15],
curve.get_points()[n*curve.get_num_points()/15],
color = YELLOW_C
)
for n in range(1, 15)
@ -411,9 +411,9 @@ class PseudoHilbertCurveAsFunctionExample(Scene):
for mob in curve, grid:
mob.scale(0.7)
index = int(0.3*line.get_num_points())
dot1 = Dot(line.points[index])
dot1 = Dot(line.get_points()[index])
arrow1 = Arrow(arg, dot1, buff = 0.1)
dot2 = Dot(curve.points[index])
dot2 = Dot(curve.get_points()[index])
arrow2 = Arrow(result.get_bottom(), dot2, buff = 0.1)
self.add(phc)
@ -487,7 +487,7 @@ class FormalDefinitionOfContinuity(Scene):
lambda t : 5.5*RIGHT + UP - 2*spiril(1-t),
density = 5*DEFAULT_POINT_DENSITY_1D,
)
Mobject.align_data(self.spiril1, self.spiril2)
Mobject.align_data_and_family(self.spiril1, self.spiril2)
self.output = Mobject(self.spiril1, self.spiril2)
self.output.ingest_submobjects()
self.output.set_color(GREEN_A)
@ -522,10 +522,10 @@ class FormalDefinitionOfContinuity(Scene):
output_points = Mobject(color = self.output_color)
n = self.output.get_num_points()
output_points.add_points(
self.output.points[int(min_input*n):int(max_input*n)]
self.output.get_points()[int(min_input*n):int(max_input*n)]
)
output_center = output_points.points[int(0.5*output_points.get_num_points())]
max_distance = get_norm(output_center-output_points.points[-1])
output_center = output_points.get_points()[int(0.5*output_points.get_num_points())]
max_distance = get_norm(output_center-output_points.get_points()[-1])
output_circle = Circle(
radius = max_distance,
color = WHITE
@ -572,8 +572,8 @@ class FormalDefinitionOfContinuity(Scene):
def label_jump(self):
jump_points = Mobject(
Point(self.spiril1.points[-1]),
Point(self.spiril2.points[0])
Point(self.spiril1.get_points()[-1]),
Point(self.spiril2.get_points()[0])
)
self.brace = Brace(jump_points, RIGHT)
self.jump = TextMobject("Jump")
@ -817,7 +817,7 @@ class WonderfulPropertyOfPseudoHilbertCurves(Scene):
for num in range(2,9):
new_curve = HilbertCurve(order = num)
new_curve.scale(0.8)
new_dot = Dot(new_curve.points[int(val*new_curve.get_num_points())])
new_dot = Dot(new_curve.get_points()[int(val*new_curve.get_num_points())])
new_num_str = TexMobject(str(num)).replace(num_str)
self.play(
Transform(curve, new_curve),
@ -874,7 +874,7 @@ class FollowManyPoints(Scene):
new_curve = HilbertCurve(order = num)
new_curve.scale(0.8)
new_dots = Mobject(*[
Dot(new_curve.points[int(val*new_curve.get_num_points())])
Dot(new_curve.get_points()[int(val*new_curve.get_num_points())])
for val in vals
])
self.play(
@ -924,7 +924,7 @@ class FormalDefinitionOfHilbertCurve(Scene):
for num in range(1, 9):
new_curve = HilbertCurve(order = num)
new_curve.scale(0.8)
new_dot = Dot(new_curve.points[int(val*new_curve.get_num_points())])
new_dot = Dot(new_curve.get_points()[int(val*new_curve.get_num_points())])
self.play(
Transform(curve, new_curve),
Transform(dot, new_dot),

View file

@ -581,8 +581,8 @@ class IntegrationByParts(Scene):
v_lines, h_lines = VGroup(), VGroup()
for alpha in np.linspace(0, 1, 30):
point = curve.point_from_proportion(alpha)
top_point = curve.points[0][1]*UP + point[0]*RIGHT
left_point = curve.points[0][0]*RIGHT + point[1]*UP
top_point = curve.get_points()[0][1]*UP + point[0]*RIGHT
left_point = curve.get_points()[0][0]*RIGHT + point[1]*UP
v_lines.add(Line(top_point, point))
h_lines.add(Line(left_point, point))
v_lines.set_color(BLUE_E)
@ -643,13 +643,13 @@ class IntegrationByParts(Scene):
)
coords.set_color_by_tex("0.00", BLACK)
dot = Dot(radius = 0.1)
dot.move_to(curve.points[0])
dot.move_to(curve.get_points()[0])
coords.next_to(dot, UP+RIGHT)
self.play(
ShowCreation(curve),
UpdateFromFunc(
dot,
lambda d : d.move_to(curve.points[-1])
lambda d : d.move_to(curve.get_points()[-1])
),
MaintainPositionRelativeTo(coords, dot),
run_time = 5,

View file

@ -991,8 +991,8 @@ class DeformToInterval(ClosedLoopScene):
self.loop.to_edge(UP)
original_loop = self.loop.copy()
cut_loop = self.loop.copy()
cut_loop.points[0] += 0.3*(UP+RIGHT)
cut_loop.points[-1] += 0.3*(DOWN+RIGHT)
cut_loop.get_points()[0] += 0.3*(UP+RIGHT)
cut_loop.get_points()[-1] += 0.3*(DOWN+RIGHT)
#Unwrap loop
self.transform_loop(cut_loop, path_arc = np.pi)
@ -1036,7 +1036,7 @@ class DeformToInterval(ClosedLoopScene):
self.loop = original_loop
self.dots = dots_copy
dot_at_1 = self.dots[-1]
dot_at_1.target.move_to(cut_loop.points[-1])
dot_at_1.target.move_to(cut_loop.get_points()[-1])
self.transform_loop(
cut_loop,
added_anims = [MoveToTarget(dot_at_1)]
@ -1291,7 +1291,7 @@ class EndpointsGluedTogether(ClosedLoopScene):
self.transform_loop(
original_loop,
added_anims = [
ApplyMethod(dot.move_to, original_loop.points[0])
ApplyMethod(dot.move_to, original_loop.get_points()[0])
for dot in dots
],
run_time = 3
@ -1729,7 +1729,7 @@ class PrepareForMobiusStrip(Scene):
)
self.wait()
self.play(*[
ApplyMethod(tri.shift, tri.points[0][0]*LEFT)
ApplyMethod(tri.shift, tri.get_points()[0][0]*LEFT)
for tri in self.triangles
])
self.play(*[

View file

@ -788,9 +788,9 @@ class RiemannFatherOfComplex(ComplexTransformationScene):
arc = Arc(-2*np.pi/3)
arc.rotate(-np.pi)
arc.add_tip()
arc.shift(input_dot.get_top()-arc.points[0]+SMALL_BUFF*UP)
arc.shift(input_dot.get_top()-arc.get_points()[0]+SMALL_BUFF*UP)
output_dot = Dot(
arc.points[-1] + SMALL_BUFF*(2*RIGHT+DOWN),
arc.get_points()[-1] + SMALL_BUFF*(2*RIGHT+DOWN),
color = MAROON_B
)
for dot, tex in (input_dot, "z"), (output_dot, "f(z)"):
@ -1660,7 +1660,7 @@ class VisualizingSSquared(ComplexTransformationScene):
lambda t : self.z_to_point(z**(1.1+0.8*t))
)
stand_in_arrow = Arrow(
arrow.points[-2], arrow.points[-1],
arrow.get_points()[-2], arrow.get_points()[-1],
tip_length = 0.2
)
arrow.add(stand_in_arrow.tip)
@ -2044,7 +2044,7 @@ class SquiggleOnExtensions(ZetaTransformationScene):
sinusoidal_func,
]
for mob in self.left_plane.family_members_with_points():
if np.all(np.abs(mob.points[:,1]) < 0.1):
if np.all(np.abs(mob.get_points()[:,1]) < 0.1):
self.left_plane.remove(mob)
new_left_planes = [
@ -2326,7 +2326,7 @@ class IntroduceAnglePreservation(VisualizingSSquared):
def put_angle_tex_next_to_arc(self, angle_tex, arc):
vect = arc.point_from_proportion(0.5)-interpolate(
arc.points[0], arc.points[-1], 0.5
arc.get_points()[0], arc.get_points()[-1], 0.5
)
unit_vect = vect/get_norm(vect)
angle_tex.move_to(arc.get_center() + 1.7*unit_vect)

View file

@ -2345,7 +2345,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction):
)
def center_of_mass(mob):
return np.apply_along_axis(np.mean, 0, mob.points)
return np.apply_along_axis(np.mean, 0, mob.get_points())
movers = [A_group, B_group, C_group]
A_ref, B_ref, C_ref = [g[4] for g in movers]

View file

@ -836,7 +836,7 @@ class WalkEquatorPostTransform(GraphScene):
target_dots.append(new_dots)
alt_eq = equator.copy()
alt_eq.points = np.array(list(reversed(alt_eq.points)))
alt_eq.set_points(list(reversed(alt_eq.get_points())))
alt_dots = dots.copy()
alt_dots.submobjects.reverse()
target_arcs += [alt_eq, alt_eq.copy()]

View file

@ -83,7 +83,7 @@ class TenDollarBill(VGroup):
oval = Circle()
oval.stretch_to_fit_height(0.7*self.height)
oval.stretch_to_fit_width(0.4*self.height)
rect.add_subpath(oval.points)
rect.add_subpath(oval.get_points())
pi = Randolph(
mode = "pondering",
@ -3079,9 +3079,9 @@ class IntroduceBlockChain(Scene):
0
])
arrow = Arrow(end+LEFT, end, buff = SMALL_BUFF)
arrow.points[0] = block.get_right()
arrow.points[1] = block.get_right() + RIGHT
arrow.points[2] = end + LEFT + SMALL_BUFF*UP
arrow.get_points()[0] = block.get_right()
arrow.get_points()[1] = block.get_right() + RIGHT
arrow.get_points()[2] = end + LEFT + SMALL_BUFF*UP
new_arrows.add(arrow)
for i in range(3):
@ -3272,10 +3272,10 @@ class DistributedBlockChainScene(DistributedLedgerScene):
b2.get_left(), b2.get_corner(UP+LEFT), 0.8
)
arrow.next_to(target_point, LEFT, 0.5*SMALL_BUFF)
arrow.points[0] = b1.get_right()
arrow.points[1] = b2.get_left()
arrow.points[2] = b1.get_corner(UP+RIGHT)
arrow.points[2] += SMALL_BUFF*LEFT
arrow.get_points()[0] = b1.get_right()
arrow.get_points()[1] = b2.get_left()
arrow.get_points()[2] = b1.get_corner(UP+RIGHT)
arrow.get_points()[2] += SMALL_BUFF*LEFT
arrows.add(arrow)
block_chain = VGroup(blocks, arrows)
block_chain.blocks = blocks
@ -4259,9 +4259,9 @@ class AliceRacesOtherMiners(DoubleSpendingAttack):
block.target.shift(dist*DOWN)
ff_head.target.shift(dist*UP)
arrow.target[1].shift(dist*DOWN)
arrow.target.points[-2:] += dist*DOWN
arrow.target.get_points()[-2:] += dist*DOWN
ff_arrow.target[1].shift(dist*UP)
ff_arrow.target.points[-2:] += dist*UP
ff_arrow.target.get_points()[-2:] += dist*UP
self.play(
Broadcast(block),
@ -5003,7 +5003,7 @@ class ShowManyExchanges(Scene):
currencies = self.get_currencies()
for currency in it.chain(currencies, cryptocurrencies):
currency.set_height(0.5)
currency.align_data(EthereumLogo())
currency.align_data_and_family(EthereumLogo())
exchange = VGroup(*[
Arrow(
p1, p2,

View file

@ -51,7 +51,7 @@ class ConfettiSpiril(Animation):
Animation.__init__(self, mobject, **kwargs)
def interpolate_submobject(self, submobject, starting_submobject, alpha):
submobject.points = np.array(starting_submobject.points)
submobject.set_points(starting_submobject.get_points())
def interpolate_mobject(self, alpha):
Animation.interpolate_mobject(self, alpha)
@ -400,7 +400,7 @@ class SymmetriesOfSquare(ThreeDScene):
for axis in OUT, RIGHT, UP:
self.rotate_square(
angle = np.pi, axis = axis,
added_anims = [randy.look_at, self.square.points[0]]
added_anims = [randy.look_at, self.square.get_points()[0]]
)
self.play(Blink(randy))
self.wait()
@ -551,7 +551,7 @@ class SymmetriesOfSquare(ThreeDScene):
def get_rotation_arcs(self, square, angle, angle_buff = SMALL_BUFF):
square_radius = get_norm(
square.points[0] - square.get_center()
square.get_points()[0] - square.get_center()
)
arc = Arc(
radius = square_radius + SMALL_BUFF,

View file

@ -569,11 +569,11 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos):
mob.set_color(self.colors[0])
def update_dot(dot):
dot.move_to(cosine_graph.points[-1])
dot.move_to(cosine_graph.get_points()[-1])
return dot
self.play(Write(cosine_label, run_time = 1))
self.play(dot.move_to, cosine_graph.points[0])
self.play(dot.move_to, cosine_graph.get_points()[0])
self.play(
ShowCreation(cosine_graph),
UpdateFromFunc(dot, update_dot),

View file

@ -107,7 +107,7 @@ class ContrastAbstractAndConcrete(Scene):
spring.next_to(ORIGIN, RIGHT)
spring.shift(
alignement_mob.get_center()[1]*UP + SMALL_BUFF*RIGHT \
-spring.points[0]
-spring.get_points()[0]
)
weight = Square(
side_length = 0.5,
@ -115,7 +115,7 @@ class ContrastAbstractAndConcrete(Scene):
fill_color = GREY_B,
fill_opacity = 1,
)
weight.move_to(spring.points[-1])
weight.move_to(spring.get_points()[-1])
spring.add(weight)
return Transform(
@ -1716,7 +1716,7 @@ class OneOverX(PiCreatureScene, GraphScene):
def introduce_graph(self):
rect_group = self.rect_group
graph = self.get_graph(lambda x : 1./x)
graph.points = np.array(list(reversed(graph.points)))
graph.set_points(list(reversed(graph.get_points())))
self.change_rectangle_group(
rect_group, 0.01,
@ -2587,7 +2587,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene):
little_triangle.get_width()/big_triangle.get_height()
)
new_angle_label.rotate(-np.pi/2)
new_angle_label.shift(little_triangle.points[0])
new_angle_label.shift(little_triangle.get_points()[0])
new_angle_label[1].rotate(np.pi/2)
little_triangle_lines = VGroup(*[

View file

@ -216,7 +216,7 @@ class DampenedSpring(Scene):
spring.scale(0.5)
spring.rotate(np.pi/6, UP)
spring.set_color(GREY)
spring.shift(-spring.points[0] + 3*LEFT)
spring.shift(-spring.get_points()[0] + 3*LEFT)
moving_spring = compact_spring.copy()

View file

@ -604,10 +604,10 @@ class FakeDiagram(TeacherStudentsScene):
for dx in (0.25, 0)
])
for graph in graphs:
end_point = graph.points[-1]
end_point = graph.get_points()[-1]
axis_point = end_point[0]*RIGHT + gs.graph_origin[1]*UP
for alpha in np.linspace(0, 1, 20):
point = interpolate(axis_point, graph.points[0], alpha)
point = interpolate(axis_point, graph.get_points()[0], alpha)
graph.add_line_to(point)
graph.set_stroke(width = 1)
graph.set_fill(opacity = 1)
@ -1686,8 +1686,8 @@ class TemperatureOverTimeOfWarmWater(GraphScene):
def update_delta_T_group(group):
brace, label = group
v_line = Line(
graph.points[-1],
graph.points[-1][0]*RIGHT + h_line.get_center()[1]*UP
graph.get_points()[-1],
graph.get_points()[-1][0]*RIGHT + h_line.get_center()[1]*UP
)
brace.set_height(v_line.get_height())
brace.next_to(v_line, RIGHT, SMALL_BUFF)

View file

@ -516,7 +516,7 @@ class AreaUnderVGraph(PlotVelocity):
for new_rects in rect_list:
new_rects.set_fill(opacity = 0.8)
rects.align_submobjects(new_rects)
rects.align_family(new_rects)
for alt_rect in rects[::2]:
alt_rect.set_fill(opacity = 0)
self.play(Transform(
@ -1191,7 +1191,7 @@ class PiecewiseConstantPlot(PlotVelocity):
dt_copy, self.v_t, self.v_t_brace
]))
)
rects.align_submobjects(next_rects)
rects.align_family(next_rects)
for every_other_rect in rects[::2]:
every_other_rect.set_fill(opacity = 0)
self.play(
@ -1269,7 +1269,7 @@ class PiecewiseConstantPlot(PlotVelocity):
)
self.play(FadeIn(brace), FadeIn(dt_to_0))
for new_rects in self.rect_list[4:]:
rects.align_submobjects(new_rects)
rects.align_family(new_rects)
for every_other_rect in rects[::2]:
every_other_rect.set_fill(opacity = 0)
self.play(
@ -1455,7 +1455,7 @@ class AreaUnderACurve(GraphScene):
self.play(ShowCreation(graph))
self.play(Write(rects))
for new_rects in rect_list[1:]:
rects.align_submobjects(new_rects)
rects.align_family(new_rects)
for every_other_rect in rects[::2]:
every_other_rect.set_fill(opacity = 0)
self.play(Transform(
@ -1993,7 +1993,7 @@ class GraphSPlusC(GraphDistanceVsTime):
"s(t) = 4t^2 - \\frac{1}{3}t^3", "+C"
)
plus_C.set_color(YELLOW)
full_label.next_to(graph.points[-1], DOWN)
full_label.next_to(graph.get_points()[-1], DOWN)
full_label.to_edge(RIGHT)
self.play(ShowCreation(graph))

View file

@ -192,7 +192,7 @@ class SecondDerivativeGraphically(GraphScene):
dot = Dot()
def get_dot_update_func(curve):
def update_dot(dot):
dot.move_to(curve.points[-1])
dot.move_to(curve.get_points()[-1])
return dot
return update_dot

View file

@ -19,7 +19,7 @@ class Britain(SVGMobject):
}
def __init__(self, **kwargs):
SVGMobject.__init__(self, **kwargs)
self.points = self[0].points
self.set_points(self[0].get_points())
self.submobjects = []
self.set_height(self.height)
self.center()
@ -420,7 +420,7 @@ class InfiniteKochZoom(Scene):
def construct(self):
small_curve = self.get_curve(self.order)
larger_curve = self.get_curve(self.order + 1)
larger_curve.scale(3, about_point = small_curve.points[0])
larger_curve.scale(3, about_point = small_curve.get_points()[0])
self.play(Transform(small_curve, larger_curve, run_time = 2))
self.repeat_frames(5)
@ -435,7 +435,7 @@ class InfiniteKochZoom(Scene):
)
koch_curve.set_width(18)
koch_curve.shift(
self.left_point - koch_curve.points[0]
self.left_point - koch_curve.get_points()[0]
)
return koch_curve

View file

@ -3175,8 +3175,8 @@ class ProportionOfSphereInBox(GraphScene):
graph = self.get_graph(lambda x : np.exp(0.1*(9-x)))
max_y = self.coords_to_point(0, 1)[1]
too_high = graph.points[:,1] > max_y
graph.points[too_high, 1] = max_y
too_high = graph.get_points()[:,1] > max_y
graph.get_points()[too_high, 1] = max_y
footnote = TextMobject("""
\\begin{flushleft}

View file

@ -42,7 +42,7 @@ class HappyHolidays(TeacherStudentsScene):
vect = LEFT
hat.set_fill(RED_D)
hat.set_stroke(width=0)
hat[0].points = hat[0].points[8 * 4:]
hat[0].set_points(hat[0].get_points()[8 * 4:])
hat[0].set_fill("#DDDDDD")
hat[2].set_fill(WHITE)
hat.add(hat[0])
@ -188,7 +188,7 @@ class UtilitiesPuzzleScene(Scene):
for i, edge in enumerate(bounding_edges):
new_edge = edge.copy()
if i%2 == 1:
new_edge.points = new_edge.points[::-1]
new_edge.set_points(new_edge.get_points()[::-1])
region.append_vectorized_mobject(new_edge)
region.set_stroke(width = 0)
region.set_fill(WHITE, opacity = 1)
@ -977,7 +977,7 @@ class NewRegionClosedOnlyForNodesWithEdges(UtilitiesPuzzleScene):
self.get_line(2, 2),
)
lit_line = lines[2].copy()
lit_line.points = lit_line.points[::-1]
lit_line.set_points(lit_line.get_points()[::-1])
lit_line.set_stroke(WHITE, 5)
region = self.get_region(*lines)
@ -1438,7 +1438,7 @@ class CyclesHaveAtLeastFour(UtilitiesPuzzleScene):
self.get_line(1, 0, self.objects.get_corner(DOWN+LEFT)),
]
for line in lines[1::2]:
line.points = line.points[::-1]
line.set_points(line.get_points()[::-1])
arrows = VGroup()
for vertex in vertices:
vect = vertices.get_center() - vertex.get_center()

View file

@ -2170,7 +2170,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene):
new_decimal.set_depth(decimal.get_depth())
new_decimal.move_to(decimal, UP)
new_decimal.set_color(decimal.get_color())
decimal.align_data(new_decimal)
decimal.align_data_and_family(new_decimal)
families = [
mob.family_members_with_points()
for mob in (decimal, new_decimal)
@ -4052,7 +4052,7 @@ class CircularPhotons(ShootPhotonThroughFilter):
arrows.scale(0.7)
arrows.rotate(np.pi/2, RIGHT)
arrows.rotate(np.pi/2, OUT)
arrows.move_to(center_of_mass(pf.points))
arrows.move_to(center_of_mass(pf.get_points()))
pf.label = arrows
pf.add(arrows)

View file

@ -552,7 +552,7 @@ class WalkerAnimation(Animation):
# Perhaps abstract this out into an "Animation updating from original object" class
def interpolate_submobject(self, submobject, starting_submobject, alpha):
submobject.points = np.array(starting_submobject.points)
submobject.set_points(starting_submobject.get_points())
def interpolate_mobject(self, alpha):
Animation.interpolate_mobject(self, alpha)
@ -1328,7 +1328,7 @@ class FuncRotater(Animation):
# Perhaps abstract this out into an "Animation updating from original object" class
def interpolate_submobject(self, submobject, starting_submobject, alpha):
submobject.points = np.array(starting_submobject.points)
submobject.set_points(starting_submobject.get_points())
def interpolate_mobject(self, alpha):
Animation.interpolate_mobject(self, alpha)
@ -1632,12 +1632,12 @@ class HasItsLimitations(Scene):
new_curved_arrow.init_points()
new_curved_arrow.add_tip()
input_diff = input_dot.get_center() - curved_arrow.points[0]
output_diff = output_dot.get_center() - curved_arrow.points[-1]
input_diff = input_dot.get_center() - curved_arrow.get_points()[0]
output_diff = output_dot.get_center() - curved_arrow.get_points()[-1]
new_curved_arrow.shift((new_input_dot.get_center() - new_curved_arrow.points[0]) - input_diff)
new_curved_arrow.shift((new_input_dot.get_center() - new_curved_arrow.get_points()[0]) - input_diff)
new_output_dot = output_dot.copy().move_to(new_curved_arrow.points[-1] + output_diff)
new_output_dot = output_dot.copy().move_to(new_curved_arrow.get_points()[-1] + output_diff)
new_output_label = output_label.copy().next_to(new_output_dot, UP + RIGHT)
dot_objects = Group(input_dot, input_label, output_dot, output_label, curved_arrow)

View file

@ -1615,13 +1615,13 @@ class DirectionOfA2DFunctionAlongABoundary(InputOutputScene):
rect_image = rect.copy()
rect_image.match_background_image_file(colorings[1])
def update_rect_image(rect_image):
rect_image.points = np.array(rect.points)
rect_image.set_points(rect.get_points())
rect_image.apply_function(self.point_function)
rect_image_update_anim = UpdateFromFunc(rect_image, update_rect_image)
def get_input_point():
return rect.points[-1]
return rect.get_points()[-1]
def get_output_coords():
in_coords = input_plane.point_to_coords(get_input_point())
@ -1639,7 +1639,7 @@ class DirectionOfA2DFunctionAlongABoundary(InputOutputScene):
out_vect,
lambda ov : ov.put_start_and_end_on(
output_plane.coords_to_point(0, 0),
rect_image.points[-1]
rect_image.get_points()[-1]
).set_color(get_color())
)
@ -1833,7 +1833,7 @@ class ForeverNarrowingLoop(InputOutputScene):
circle_image.match_background_image_file(output_coloring)
def update_circle_image(circle_image):
circle_image.points = circle.points
circle_image.set_points(circle.get_points())
circle_image.apply_function(self.point_function)
circle_image.make_smooth()
@ -2234,7 +2234,7 @@ class TransitionFromPathsToBoundaries(ColorMappedObjectsScene):
dot.move_to, path1.get_start()
)
for square in squares:
self.position_dot(square.points[0])
self.position_dot(square.get_points()[0])
kwargs = {
"run_time" : 4,
"rate_func" : bezier([0, 0, 1, 1]),
@ -2246,11 +2246,11 @@ class TransitionFromPathsToBoundaries(ColorMappedObjectsScene):
)
self.wait()
self.play(
dot.move_to, joint_rect.points[0],
dot.move_to, joint_rect.get_points()[0],
FadeOut(squares),
FadeIn(joint_rect),
)
self.position_dot(joint_rect.points[0])
self.position_dot(joint_rect.get_points()[0])
self.play(
Transform(left_square.label[0], joint_rect.label[0]),
Transform(
@ -2378,7 +2378,7 @@ class BreakDownLoopWithNonzeroWinding(TransitionFromPathsToBoundaries):
for var in (x, y)
])
self.position_dot(joint_rect.points[0])
self.position_dot(joint_rect.get_points()[0])
self.add(joint_rect)
self.play(
MoveAlongPath(dot, joint_rect, rate_func = bezier([0, 0, 1, 1])),
@ -2492,8 +2492,8 @@ class MonomialTerm(PathContainingZero):
out_loop.apply_function(self.point_function)
out_loop.match_background_image_file(self.output_coloring)
get_in_point = lambda : loop.points[-1]
get_out_point = lambda : out_loop.points[-1]
get_in_point = lambda : loop.get_points()[-1]
get_out_point = lambda : out_loop.get_points()[-1]
in_origin = self.input_plane.coords_to_point(0, 0)
out_origin = self.output_plane.coords_to_point(0, 0)
@ -2589,7 +2589,7 @@ class PolynomialTerms(MonomialTerm):
out_line = line.copy()
update_out_line = UpdateFromFunc(
out_line,
lambda m : m.set_points(line.points).apply_function(self.point_function),
lambda m : m.set_points(line.get_points()).apply_function(self.point_function),
)
self.play(
@ -2610,7 +2610,7 @@ class PolynomialTerms(MonomialTerm):
update_out_loop = UpdateFromFunc(
out_loop,
lambda m : m.set_points(loop.points).apply_function(self.point_function)
lambda m : m.set_points(loop.get_points()).apply_function(self.point_function)
)
self.add(
@ -2799,7 +2799,7 @@ class WindingNumbersInInputOutputContext(PathContainingZero):
out_loop.match_background_image_file(self.output_coloring)
update_out_loop = Mobject.add_updater(
out_loop,
lambda m : m.set_points(in_loop.points).apply_function(self.point_function)
lambda m : m.set_points(in_loop.get_points()).apply_function(self.point_function)
)
# self.add(update_out_loop)

View file

@ -713,7 +713,7 @@ class StartingCalc101(PiCreatureScene):
)
),
weight.add_updater(
lambda w: w.move_to(spring.points[-1])
lambda w: w.move_to(spring.get_points()[-1])
)
]

View file

@ -101,7 +101,7 @@ class AngleUpdater(ContinualAnimation):
)
new_arc.init_points()
new_arc.move_arc_center_to(self.spotlight.get_source_point())
self.angle_arc.points = new_arc.points
self.angle_arc.set_points(new_arc.get_points())
self.angle_arc.add_tip(tip_length = ARC_TIP_LENGTH,
at_start = True, at_end = True)

View file

@ -73,7 +73,7 @@ class AngleUpdater(ContinualAnimation):
)
new_arc.init_points()
new_arc.move_arc_center_to(self.spotlight.get_source_point())
self.angle_arc.points = new_arc.points
self.angle_arc.set_points(new_arc.get_points())
self.angle_arc.add_tip(
tip_length = ARC_TIP_LENGTH,
at_start = True, at_end = True
@ -739,7 +739,7 @@ class MathematicalWebOfConnections(PiCreatureScene):
def draw_circle(self):
semi_circle = Arc(angle = np.pi, radius = 2)
radius = Line(ORIGIN, semi_circle.points[0])
radius = Line(ORIGIN, semi_circle.get_points()[0])
radius.set_color(BLUE)
semi_circle.set_color(YELLOW)
@ -749,7 +749,7 @@ class MathematicalWebOfConnections(PiCreatureScene):
decimal = DecimalNumber(0)
def decimal_position_update_func(decimal):
decimal.move_to(semi_circle.points[-1])
decimal.move_to(semi_circle.get_points()[-1])
decimal.shift(0.3*radius.get_vector())
one = TexMobject("1")
@ -1386,11 +1386,11 @@ class IntroduceScreen(Scene):
rays.set_stroke(YELLOW, 1)
max_angle = np.max([
angle_of_vector(point - source_point)
for point in screen.points
for point in screen.get_points()
])
min_angle = np.min([
angle_of_vector(point - source_point)
for point in screen.points
for point in screen.get_points()
])
for ray in rays:
if min_angle <= ray.get_angle() <= max_angle:
@ -2685,7 +2685,7 @@ class IPTScene(TwoLightSourcesScene, ZoomedScene):
anims = []
if x > 0:
anims.append(FadeOut(triangle.copy()))
anims.append(GrowFromPoint(triangle, triangle.points[0]))
anims.append(GrowFromPoint(triangle, triangle.get_points()[0]))
self.play(*anims)
self.play(FadeOut(triangle))
pass

View file

@ -237,7 +237,7 @@ class MathIsDeep(PiCreatureScene):
# pn.fade(1)
# pn.set_color(RED)
# pn.move_to(letter)
# num_mobs[1].add_subpath(num_mobs[1].points)
# num_mobs[1].add_subpath(num_mobs[1].get_points())
self.play(
LaggedStartMap(

View file

@ -282,8 +282,8 @@ class ShowWritingTrajectory(TeacherStudentsScene):
for x in np.arange(0, 1 + step, step)
])
arrow = Arrow(
solid_path.points[-2],
solid_path.points[-1],
solid_path.get_points()[-2],
solid_path.get_points()[-1],
buff=0
)
dashed_path.add(arrow.tip)
@ -1409,8 +1409,8 @@ class FluidFlowAsHillGradient(CylinderModel, ThreeDScene):
}
)
for line in stream_lines:
line.points[:, 2] = np.apply_along_axis(
potential, 1, line.points
line.get_points()[:, 2] = np.apply_along_axis(
potential, 1, line.get_points()
)
stream_lines_animation = self.get_stream_lines_animation(
stream_lines
@ -2005,7 +2005,7 @@ class PureCylinderFlow(Scene):
)
self.add(stream_lines)
for stream_line in stream_lines:
if get_norm(stream_line.points[0]) < 1:
if get_norm(stream_line.get_points()[0]) < 1:
stream_lines.remove(stream_line)
self.modify_flow(stream_lines)
@ -4123,7 +4123,7 @@ class NoChargesOverlay(Scene):
rect.set_fill(BLUE_D, 0.75)
circle = Circle(radius=1.5, num_anchors=5000)
circle.rotate(135 * DEGREES)
rect.add_subpath(circle.points)
rect.add_subpath(circle.get_points())
words = TextMobject("No charges outside wire")
words.scale(1.5)

View file

@ -2339,7 +2339,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene):
odm_words_outline = VGroup()
for letter in odm_words:
mob = VMobject()
mob.points = letter.points
mob.set_points(letter.get_points())
odm_words_outline.add(mob)
odm_words_outline.set_fill(opacity = 0)
odm_words_outline.set_stroke(YELLOW, 1)

View file

@ -72,8 +72,8 @@ class FlatCoin(UprightCoin):
self.stretch_in_place(self.foreshortening, 1)
# draw the edge
control_points1 = self.points[12:25].tolist()
control_points2 = self.copy().shift(self.thickness * DOWN).points[12:25].tolist()
control_points1 = self.get_points()[12:25].tolist()
control_points2 = self.copy().shift(self.thickness * DOWN).get_points()[12:25].tolist()
edge_anchors_and_handles = control_points1
edge_anchors_and_handles.append(edge_anchors_and_handles[-1] + self.thickness * DOWN)
edge_anchors_and_handles.append(edge_anchors_and_handles[-1] + self.thickness * UP)

View file

@ -34,7 +34,7 @@ def get_fourier_graph(
])
graph.set_color(color)
f_min, f_max = [
axes.x_axis.point_to_number(graph.points[i])
axes.x_axis.point_to_number(graph.get_points()[i])
for i in (0, -1)
]
graph.underlying_function = lambda f : axes.y_axis.point_to_number(
@ -921,8 +921,8 @@ class FourierMachineScene(Scene):
self.get_frequency_axes()
func = time_graph.underlying_function
t_axis = self.time_axes.x_axis
t_min = t_axis.point_to_number(time_graph.points[0])
t_max = t_axis.point_to_number(time_graph.points[-1])
t_min = t_axis.point_to_number(time_graph.get_points()[0])
t_max = t_axis.point_to_number(time_graph.get_points()[-1])
f_max = self.frequency_axes.x_max
# result = get_fourier_graph(
# self.frequency_axes, func, t_min, t_max,
@ -930,12 +930,12 @@ class FourierMachineScene(Scene):
# )
# too_far_right_point_indices = [
# i
# for i, point in enumerate(result.points)
# for i, point in enumerate(result.get_points())
# if self.frequency_axes.x_axis.point_to_number(point) > f_max
# ]
# if too_far_right_point_indices:
# i = min(too_far_right_point_indices)
# prop = float(i)/len(result.points)
# prop = float(i)/len(result.get_points())
# result.pointwise_become_partial(result, 0, prop)
# return result
return self.frequency_axes.get_graph(
@ -997,8 +997,8 @@ class FourierMachineScene(Scene):
vector = Vector(UP, color = WHITE)
graph_copy = graph.copy()
x_axis = self.time_axes.x_axis
x_min = x_axis.point_to_number(graph.points[0])
x_max = x_axis.point_to_number(graph.points[-1])
x_min = x_axis.point_to_number(graph.get_points()[0])
x_max = x_axis.point_to_number(graph.get_points()[-1])
def update_vector(vector, alpha):
x = interpolate(x_min, x_max, alpha)
vector.put_start_and_end_on(
@ -3342,7 +3342,7 @@ class ScaleUpCenterOfMass(WriteComplexExponentialExpression):
self.remove(graph.polarized_mobject)
self.play(
com_dot.move_to,
center_of_mass(short_graph.polarized_mobject.points),
center_of_mass(short_graph.polarized_mobject.get_points()),
com_vector_update,
time_span.restore,
ShowCreation(short_graph.polarized_mobject),
@ -3391,7 +3391,7 @@ class ScaleUpCenterOfMass(WriteComplexExponentialExpression):
long_graph.move_to(graph, LEFT)
self.play(
com_dot.move_to,
center_of_mass(long_graph.polarized_mobject.points),
center_of_mass(long_graph.polarized_mobject.get_points()),
com_vector_update,
time_span.stretch, 2, 0, {"about_edge" : LEFT},
*[
@ -3442,7 +3442,7 @@ class ScaleUpCenterOfMass(WriteComplexExponentialExpression):
self.get_polarized_mobject(very_long_graph, freq = 2.0)
self.play(
com_dot.move_to,
center_of_mass(very_long_graph.polarized_mobject.points),
center_of_mass(very_long_graph.polarized_mobject.get_points()),
com_vector_update,
ShowCreation(
very_long_graph,
@ -3711,7 +3711,7 @@ class SummarizeTheFullTransform(DrawFrequencyPlot):
imaginary_fourier_graph.set_color(BLUE)
imaginary_fourier_graph.shift(
frequency_axes.x_axis.get_right() - \
imaginary_fourier_graph.points[-1],
imaginary_fourier_graph.get_points()[-1],
)
real_part = TextMobject(
@ -3995,7 +3995,7 @@ class ShowUncertaintyPrinciple(Scene):
if axes == bottom_axes:
f = 1./f
new_graph = axes.get_graph(get_bell_func(f))
graph.points = new_graph.points
graph.set_points(new_graph.get_points())
return update_graph
factors = [0.3, 0.1, 2, 10, 100, 0.01, 0.5]

View file

@ -2196,7 +2196,7 @@ class KeplersSecondLaw(AskAboutEllipses):
self.show_area_sweep()
end_prop = orbit.proportion
arc = self.get_arc(start_prop, end_prop)
radius = Line(sun_point, arc.points[0])
radius = Line(sun_point, arc.get_points()[0])
radius.set_color(WHITE)
radius_words = self.get_radius_words(radius, "Short")
@ -2233,7 +2233,7 @@ class KeplersSecondLaw(AskAboutEllipses):
self.show_area_sweep()
end_prop = orbit.proportion
short_arc = self.get_arc(start_prop, end_prop)
long_radius = Line(sun_point, short_arc.points[0])
long_radius = Line(sun_point, short_arc.get_points()[0])
long_radius.set_color(WHITE)
long_radius_words = self.get_radius_words(long_radius, "Long")
@ -2281,11 +2281,11 @@ class KeplersSecondLaw(AskAboutEllipses):
# Add lines from start
result = VMobject()
result.append_vectorized_mobject(
Line(sun_point, arc.points[0])
Line(sun_point, arc.get_points()[0])
)
result.append_vectorized_mobject(arc)
result.append_vectorized_mobject(
Line(arc.points[-1], sun_point)
Line(arc.get_points()[-1], sun_point)
)
result.set_stroke(WHITE, width=0)
@ -3097,11 +3097,11 @@ class ShowEqualAngleSlices(IntroduceShapeOfVelocities):
wedge = VMobject()
wedge.append_vectorized_mobject(
Line(sun_center, arc.points[0])
Line(sun_center, arc.get_points()[0])
)
wedge.append_vectorized_mobject(arc)
wedge.append_vectorized_mobject(
Line(arc.points[-1], sun_center)
Line(arc.get_points()[-1], sun_center)
)
wedges.add(wedge)
@ -3336,7 +3336,7 @@ class ShowEqualAngleSlices(IntroduceShapeOfVelocities):
self.wait()
self.play(
comet.move_to, arc.points[0],
comet.move_to, arc.get_points()[0],
path_arc=90 * DEGREES
)
force_vector_update.update(0)
@ -4125,11 +4125,11 @@ class UseVelocityDiagramToDeduceCurve(ShowEqualAngleSlices):
def get_wedge(self, arc, center_point, opacity=0.8):
wedge = VMobject()
wedge.append_vectorized_mobject(
Line(center_point, arc.points[0])
Line(center_point, arc.get_points()[0])
)
wedge.append_vectorized_mobject(arc)
wedge.append_vectorized_mobject(
Line(arc.points[-1], center_point)
Line(arc.get_points()[-1], center_point)
)
wedge.set_stroke(width=0)
wedge.set_fill(COBALT, opacity=opacity)

View file

@ -44,7 +44,7 @@ class LabelTracksLine(Animation):
def interpolate_mobject(self,alpha):
line_center = self.line.get_center()
line_end = self.line.points[-1]
line_end = self.line.get_points()[-1]
v = line_end - line_center
v = v/get_norm(v)
w = np.array([-v[1],v[0],0])
@ -220,7 +220,7 @@ def get_image(name):
def get_circle_drawing_terms(radius = 1, positioning_func = lambda m : m.center()):
circle = Circle(color = YELLOW, radius = 1.25)
positioning_func(circle)
radius = Line(circle.get_center(), circle.points[0])
radius = Line(circle.get_center(), circle.get_points()[0])
radius.set_color(WHITE)
one = TexMobject("1")
one.scale(0.75)
@ -459,7 +459,7 @@ class HistoryOfOurPeople(TeacherStudentsScene):
class TauFalls(Scene):
def construct(self):
tau = TauCreature()
bottom = np.min(tau.body.points[:,1])*UP
bottom = np.min(tau.body.get_points()[:,1])*UP
angle = -0.15*TAU
tau.generate_target()
tau.target.change("angry")

View file

@ -1199,7 +1199,7 @@ class RuleForQuaternionRotations(EulerAnglesAndGimbal):
label.to_corner(UL)
brace = Brace(half_angle_q, DOWN)
q_label = brace.get_tex("q")
full_angle_q.align_data(half_angle_q)
full_angle_q.align_data_and_family(half_angle_q)
rect = SurroundingRectangle(full_angle_q[5])
for mob in full_angle_q, half_angle_q, brace, q_label, rect:

View file

@ -23,7 +23,7 @@ def stereo_project_point(point, axis=0, r=1, max_norm=10000):
def stereo_project(mobject, axis=0, r=1, outer_r=10, **kwargs):
epsilon = 1
for submob in mobject.family_members_with_points():
points = submob.points
points = submob.get_points()
n = len(points)
for i in range(n):
if points[i, axis] == -r:
@ -44,10 +44,10 @@ def stereo_project(mobject, axis=0, r=1, outer_r=10, **kwargs):
# If all points are outside a certain range, this
# shouldn't be displayed
norms = np.apply_along_axis(get_norm, 1, submob.points)
norms = np.apply_along_axis(get_norm, 1, submob.get_points())
if np.all(norms > outer_r):
# TODO, instead set opacity?
# submob.points[:, :] = 0
# submob.get_points()[:, :] = 0
submob.set_fill(opacity=0)
submob.set_stroke(opacity=0)
@ -176,7 +176,7 @@ class CheckeredCircle(Circle):
def __init__(self, **kwargs):
Circle.__init__(self, **kwargs)
pieces = self.get_pieces(self.n_pieces)
self.points = np.zeros((0, 3))
self.set_points(np.zeros((0, 3)))
self.add(*pieces)
n_colors = len(self.colors)
for i, color in enumerate(self.colors):
@ -320,7 +320,7 @@ class StereoProjectedCircleFromHypersphere(CheckeredCircle):
def remove_large_pieces(self):
for piece in self:
length = get_norm(piece.points[0] - piece.points[-1])
length = get_norm(piece.get_points()[0] - piece.get_points()[-1])
violations = [
length > self.max_length,
get_norm(piece.get_center()) > self.max_r,
@ -344,11 +344,11 @@ class QuaternionTracker(ValueTracker):
self.add_updater(lambda q: q.normalize())
def set_value(self, vector):
self.points = np.array(vector).reshape((1, 4))
self.set_points(np.array(vector).reshape((1, 4)))
return self
def get_value(self):
return self.points[0]
return self.get_points()[0]
def normalize(self):
self.set_value(normalize(
@ -1595,8 +1595,8 @@ class DefineComplexNumbersPurelyAlgebraically(Scene):
brace.get_bottom() + SMALL_BUFF * DOWN,
target.get_top() + MED_SMALL_BUFF * UP,
)
arrow.points[1] = arrow.points[0] + DOWN
arrow.points[2] = arrow.points[3] + UP
arrow.get_points()[1] = arrow.get_points()[0] + DOWN
arrow.get_points()[2] = arrow.get_points()[3] + UP
tip = RegularPolygon(3, start_angle=-100 * DEGREES)
tip.set_height(0.2)
tip.set_stroke(width=0)
@ -2568,7 +2568,7 @@ class IntroduceStereographicProjection(MovingCameraScene):
n = self.n_sample_points
rotater = 1
if hasattr(self, "circle_shadow"):
point = self.circle_shadow[0].points[0]
point = self.circle_shadow[0].get_points()[0]
rotater = complex(*point[:2])
rotater /= abs(rotater)
numbers = [
@ -2634,7 +2634,7 @@ class IntroduceStereographicProjectionLinusView(IntroduceStereographicProjection
dots.set_stroke(BLACK, 1)
def generate_dot_updater(circle_piece):
return lambda d: d.move_to(circle_piece.points[0])
return lambda d: d.move_to(circle_piece.get_points()[0])
for dot, piece in zip(dots, circle[::(len(circle) // 8)]):
dot.add_updater(generate_dot_updater(piece))
@ -2834,7 +2834,7 @@ class ShowRotationUnderStereographicProjection(IntroduceStereographicProjection)
lines = always_redraw(self.get_lines)
def generate_dot_updater(circle_piece):
return lambda d: d.move_to(circle_piece.points[0])
return lambda d: d.move_to(circle_piece.get_points()[0])
for circ, color in [(self.circle_shadow, RED), (self.circle, WHITE)]:
for piece in circ[::(len(circ) // 8)]:
@ -2861,7 +2861,7 @@ class ShowRotationUnderStereographicProjection(IntroduceStereographicProjection)
circle_shadow = self.circle_shadow
def get_rotated_one_point():
return circle_shadow[0].points[0]
return circle_shadow[0].get_points()[0]
def get_angle():
return angle_of_vector(get_rotated_one_point())
@ -3618,7 +3618,7 @@ class TwoDStereographicProjection(IntroduceFelix):
circle_path.rotate(-90 * DEGREES)
self.play(FadeInFromLarge(circle))
self.play(point_mob.move_to, circle_path.points[0])
self.play(point_mob.move_to, circle_path.get_points()[0])
self.play(MoveAlongPath(point_mob, circle_path, run_time=6))
self.move_camera(
phi=0,
@ -5589,10 +5589,10 @@ class ShowMultiplicationBy135Example(RuleOfQuaternionMultiplication):
label.set_background_stroke(width=0)
def get_one_point():
return self.circle_1i[0].points[0]
return self.circle_1i[0].get_points()[0]
def get_j_point():
return self.circle_jk[0].points[0]
return self.circle_jk[0].get_points()[0]
one_point = VectorizedPoint()
one_point.add_updater(lambda v: v.set_location(get_one_point()))
@ -5834,7 +5834,7 @@ class ShowArbitraryMultiplication(ShowMultiplicationBy135Example):
one_dot.set_color(YELLOW_E)
one_dot.move_to(ORIGIN)
one_dot.add_updater(
lambda m: m.move_to(circle1[0].points[0])
lambda m: m.move_to(circle1[0].get_points()[0])
)
self.add(one_dot)
@ -5852,7 +5852,7 @@ class ShowArbitraryMultiplication(ShowMultiplicationBy135Example):
run_time=2
)
hand.add_updater(
lambda h: h.move_to(circle1[0].points[0], LEFT)
lambda h: h.move_to(circle1[0].get_points()[0], LEFT)
)
for quat in [special_q, [1, 0, 0, 0], special_q]:
@ -6367,8 +6367,8 @@ class ThumbnailP1(RuleOfQuaternionMultiplication):
# unit_sphere.set_stroke(width=0)
# proj_sphere.set_fill_by_checkerboard(BLUE_E, BLUE, opacity=0.8)
for face in proj_sphere:
face.points = face.points[::-1]
max_r = np.max(np.apply_along_axis(get_norm, 1, face.points))
face.set_points(face.get_points()[::-1])
max_r = np.max(np.apply_along_axis(get_norm, 1, face.get_points()))
if max_r > 30:
face.fade(1)

View file

@ -2568,7 +2568,7 @@ class UnwrappedCircleLogic(UnfoldCircles):
line_word.shift(line.get_center())
curve = line.copy()
curve.points[1] = unwrapped_circle.get_corner(DL)
curve.get_points()[1] = unwrapped_circle.get_corner(DL)
not_line = TextMobject("Not line")
not_line.rotate(line.get_angle() / 2)
not_line.move_to(line_word)
@ -2898,7 +2898,7 @@ class SecondProof(SpecialThreeDScene):
# shaded_back_half = back_half.copy()
# for piece in shaded_back_half.family_members_with_points():
# piece.points = piece.points[::-1]
# piece.set_points(piece.get_points()[::-1])
# shaded_back_half.scale(0.999)
# shaded_back_half.set_fill(opacity=0.5)
@ -3208,10 +3208,10 @@ class SecondProof(SpecialThreeDScene):
for piece in ring:
piece.insert_n_curves(4)
piece.on_sphere = True
piece.points = np.array([
*piece.points[3:-1],
*piece.points[:3],
piece.points[3]
piece.set_points([
*piece.get_points()[3:-1],
*piece.get_points()[:3],
piece.get_points()[3]
])
return rings
@ -3239,7 +3239,7 @@ class SecondProof(SpecialThreeDScene):
def get_theta(self, ring):
piece = ring[0]
point = piece.points[3]
point = piece.get_points()[3]
return np.arccos(point[2] / get_norm(point))
def get_theta_group(self, theta):

View file

@ -175,7 +175,7 @@ class RadarPulseSingleton(ContinualAnimation):
)
self.arc.set_height(0.75*radar_dish.get_height())
self.arc.move_to(radar_dish, UP+RIGHT)
self.start_points = np.array(self.arc.points)
self.start_points = np.array(self.arc.get_points())
self.start_center = self.arc.get_center()
self.finished = False
@ -184,7 +184,7 @@ class RadarPulseSingleton(ContinualAnimation):
def update_mobject(self, dt):
arc = self.arc
total_distance = self.speed*self.internal_time
arc.points = np.array(self.start_points)
arc.set_points(self.start_points)
arc.shift(total_distance*self.direction)
if self.internal_time < self.fade_in_time:
@ -202,10 +202,10 @@ class RadarPulseSingleton(ContinualAnimation):
#Don't use elif in case the above code creates reflection_distance
if self.reflection_distance is not None:
delta_distance = total_distance - self.reflection_distance
point_distances = np.dot(self.direction, arc.points.T)
point_distances = np.dot(self.direction, arc.get_points().T)
diffs = point_distances - self.reflection_distance
shift_vals = np.outer(-2*np.maximum(diffs, 0), self.direction)
arc.points += shift_vals
arc.set_points(arc.get_points() + shift_vals)
#Check if done
arc_point = arc.get_edge_center(-self.direction)
@ -869,8 +869,8 @@ class TwoCarsAtRedLight(Scene):
new_frequency_graph.match_color(self.frequency_graph)
def pin_freq_graph_end_points(freq_graph):
freq_graph.points[0] = frequency_axes.coords_to_point(0, 0)
freq_graph.points[-1] = frequency_axes.coords_to_point(2, 0)
freq_graph.get_points()[0] = frequency_axes.coords_to_point(0, 0)
freq_graph.get_points()[-1] = frequency_axes.coords_to_point(2, 0)
self.play(LaggedStartMap(
FadeOut, VGroup(
@ -973,7 +973,7 @@ class VariousMusicalNotes(Scene):
)
graph = get_graph()
def graph_update(graph):
graph.points = get_graph().points
graph.set_points(get_graph().get_points())
graph_update_anim = UpdateFromFunc(graph, graph_update)
def change_width_anim(width, **kwargs):
a = 2.0/(width**2)
@ -3960,9 +3960,9 @@ class MusicalNote(AddingPureFrequencies):
v_line = DashedLine(ORIGIN, 0.5*UP)
v_line_update = UpdateFromFunc(
v_line, lambda l : l.put_start_and_end_on_with_projection(
graph.points[-1],
graph.get_points()[-1],
axes.x_axis.number_to_point(
axes.x_axis.point_to_number(graph.points[-1])
axes.x_axis.point_to_number(graph.get_points()[-1])
)
)
)

View file

@ -959,10 +959,10 @@ class TemptingFormula(ShowTwoPerspectives, RandomnessVsProportions):
buff=MED_LARGE_BUFF,
color=BLUE,
)
# B_rect.points[0] += 0.2 * RIGHT
# B_rect.points[-1] += 0.2 * RIGHT
# B_rect.points[3] += 0.2 * LEFT
# B_rect.points[4] += 0.2 * LEFT
# B_rect.get_points()[0] += 0.2 * RIGHT
# B_rect.get_points()[-1] += 0.2 * RIGHT
# B_rect.get_points()[3] += 0.2 * LEFT
# B_rect.get_points()[4] += 0.2 * LEFT
# B_rect.make_jagged()
self.play(FadeIn(ht_grid_group))

View file

@ -883,8 +883,8 @@ class StateGoal(PiCreatureScene, Scene):
rects = VGroup()
for curve in CurvesAsSubmobjects(gold):
p1 = curve.points[0]
p2 = curve.points[-1]
p1 = curve.get_points()[0]
p2 = curve.get_points()[-1]
rect = Polygon(p1, p2, p2 + 2 * OUT, p1 + 2 * OUT)
rect.match_style(gold)
# rect.set_fill(GOLD)

View file

@ -41,7 +41,7 @@ class Block(Square):
return label
def get_points_defining_boundary(self):
return self.points
return self.get_points()
def mass_to_color(self, mass):
colors = [
@ -564,7 +564,7 @@ class LightBouncing(MovingCameraScene):
),
UpdateFromFunc(
dot,
lambda m: m.move_to(beam.points[-1])
lambda m: m.move_to(beam.get_points()[-1])
),
)

View file

@ -609,7 +609,7 @@ class AskAboutFindingNewVelocities(Scene):
self.vps_point.rotate(2 * theta, about_point=ORIGIN)
def reflect_block2(self):
self.vps_point.points[:, 1] *= -1
self.vps_point.get_points()[:, 1] *= -1
def halt(self):
self.is_halted = True
@ -1694,7 +1694,7 @@ class AnalyzeCircleGeometry(CircleDiagramFromSlidingBlocks, MovingCameraScene):
wedge = arc.copy()
wedge.add_line_to(ORIGIN)
wedge.add_line_to(wedge.points[0])
wedge.add_line_to(wedge.get_points()[0])
wedge.set_stroke(width=0)
wedge.set_fill(arc.get_color(), 0.2)
wedges.add(wedge)
@ -2558,7 +2558,7 @@ class ActanAndTanGraphs(GraphScene):
labels = VGroup(id_label, arctan_label, tan_label)
for label, graph in zip(labels, graphs):
label.match_color(graph)
label.next_to(graph.points[-1], RIGHT)
label.next_to(graph.get_points()[-1], RIGHT)
if label.get_bottom()[1] > FRAME_HEIGHT / 2:
label.next_to(graph.point_from_proportion(0.75), LEFT)

View file

@ -343,7 +343,7 @@ class MirrorScene(Scene):
result.append(
UpdateFromFunc(
self.beam_point,
lambda m: m.move_to(smallest_flash.mobject.points[-1])
lambda m: m.move_to(smallest_flash.mobject.get_points()[-1])
)
)
@ -354,7 +354,7 @@ class MirrorScene(Scene):
)
ghost_beam_point_update = UpdateFromFunc(
self.ghost_beam_point,
lambda m: m.move_to(ghost_flash.mobject.points[-1])
lambda m: m.move_to(ghost_flash.mobject.get_points()[-1])
)
result += [
ghost_flash,
@ -435,7 +435,7 @@ class ReflectWorldThroughMirrorNew(MirrorScene):
randy.tracked_mobject = self.trajectory
randy.add_updater(
lambda m: m.look_at(
m.tracked_mobject.points[-1]
m.tracked_mobject.get_points()[-1]
)
)
self.add(randy)
@ -450,7 +450,7 @@ class ReflectWorldThroughMirrorNew(MirrorScene):
def add_ghost_beam_point(self):
self.ghost_beam_point.add_updater(
lambda m: m.move_to(
self.ghost_trajectory.points[-1]
self.ghost_trajectory.get_points()[-1]
)
)
self.add(self.ghost_beam_point)
@ -658,7 +658,7 @@ class ReflectWorldThroughMirrorNew(MirrorScene):
self.ghost_beam_point.clear_updaters()
self.ghost_beam_point.add_updater(
lambda m: m.move_to(
gt_beam_anims[0].mobject.points[-1]
gt_beam_anims[0].mobject.get_points()[-1]
)
)
self.randy.tracked_mobject = t_beam_anims[0].mobject
@ -927,7 +927,7 @@ class MirrorAndWiresOverlay(MirrorScene):
)
d_trajectory.match_style(g_trajectory)
g_trajectory.points[0] += 0.2 * RIGHT + 0.1 * DOWN
g_trajectory.get_points()[0] += 0.2 * RIGHT + 0.1 * DOWN
g_trajectory.make_jagged()
for x in range(3):
self.play(

View file

@ -1014,10 +1014,10 @@ class EqualMassCase(PositionPhaseSpaceScene):
flash_mob = flashes[0].mobject # Lol
def update_ps_point_from_flas_mob(ps_point):
if len(flash_mob.points) > 0:
ps_point.move_to(flash_mob.points[-1])
if len(flash_mob.get_points()) > 0:
ps_point.move_to(flash_mob.get_points()[-1])
else:
ps_point.move_to(trajectory.points[0])
ps_point.move_to(trajectory.get_points()[0])
# Mirror words
xy_line = self.d1_eq_d2_line
@ -1097,7 +1097,7 @@ class FailedAngleRelation(PositionPhaseSpaceScene):
arcs = self.get_arcs(trajectory)
equation = self.get_word_equation()
equation.next_to(
trajectory.points[0], UR, MED_SMALL_BUFF,
trajectory.get_points()[0], UR, MED_SMALL_BUFF,
index_of_submobject_to_align=0,
)
@ -1350,7 +1350,7 @@ class RescaleCoordinates(PositionPhaseSpaceScene, MovingCameraScene):
def put_into_frame(self):
rect = ScreenRectangle(height=FRAME_HEIGHT + 10)
inner_rect = ScreenRectangle(height=FRAME_HEIGHT)
rect.add_subpath(inner_rect.points[::-1])
rect.add_subpath(inner_rect.get_points()[::-1])
rect.set_fill("#333333", opacity=1)
frame = self.camera_frame

View file

@ -940,7 +940,7 @@ class WherePendulumLeads(PiCreatureScene):
weight = Dot(radius=0.25)
weight.add_updater(lambda m: m.move_to(
spring.points[-1]
spring.get_points()[-1]
))
weight.set_color(BLUE)
weight.set_sheen(1, UL)

View file

@ -503,7 +503,7 @@ class VisualizeStates(Scene):
def update_trajectory(traj):
point = mobject.get_center()
if get_norm(trajectory.points[-1] == point) > 0.05:
if get_norm(trajectory.get_points()[-1] == point) > 0.05:
traj.add_smooth_curve_to(point)
trajectory.add_updater(update_trajectory)
return trajectory
@ -699,7 +699,7 @@ class IntroduceVectorField(VisualizeStates):
trajectory.start_new_path(dot.get_center())
dt = 0.01
for x in range(130):
p = trajectory.points[-1]
p = trajectory.get_points()[-1]
dp_dt = self.vector_field_func(p)
trajectory.add_smooth_curve_to(p + dp_dt * dt)
self.tie_state_to_dot_position(state, dot)
@ -1010,7 +1010,7 @@ class ShowHighVelocityCase(ShowPendulumPhaseFlow, MovingCameraScene):
rate_func=linear,
),
UpdateFromFunc(
dot, lambda d: d.move_to(traj.points[-1])
dot, lambda d: d.move_to(traj.get_points()[-1])
),
]
if get_norm(self.frame_shift_vect) > 0:
@ -1030,7 +1030,7 @@ class ShowHighVelocityCase(ShowPendulumPhaseFlow, MovingCameraScene):
traj = VMobject()
traj.start_new_path(start_point)
for x in range(int(time / dt)):
last_point = traj.points[-1]
last_point = traj.get_points()[-1]
for y in range(added_steps):
dp_dt = field.func(last_point)
last_point += dp_dt * dt / added_steps
@ -1242,7 +1242,7 @@ class SpectrumOfStartingStates(ShowHighVelocityCase):
def update_dots(ds):
for d, t in zip(ds, trajs):
d.move_to(t.points[-1])
d.move_to(t.get_points()[-1])
return ds
dots.add_updater(update_dots)
@ -1362,7 +1362,7 @@ class AskAboutStability(ShowHighVelocityCase):
def update_dots(ds):
for t, d in zip(trajs, ds):
d.move_to(t.points[-1])
d.move_to(t.get_points()[-1])
dots.add_updater(update_dots)
self.add(trajs, dots)
self.play(
@ -1522,7 +1522,7 @@ class LovePhaseSpace(ShowHighVelocityCase):
def update_dots(ds):
for d, t in zip(ds, ds.trajs):
d.move_to(t.points[-1])
d.move_to(t.get_points()[-1])
dots.add_updater(update_dots)
self.add(trajs, dots)

View file

@ -2307,7 +2307,7 @@ class ThreeBodiesInSpace(SpecialThreeDScene):
def add_trajectories(self):
def update_trajectory(traj, dt):
new_point = traj.body.point
if get_norm(new_point - traj.points[-1]) > 0.01:
if get_norm(new_point - traj.get_points()[-1]) > 0.01:
traj.add_smooth_curve_to(new_point)
for body in self.bodies:
@ -2772,7 +2772,7 @@ class LoveExample(PiCreatureScene):
)
s_alpha = squish_rate_func(smooth, 0.25, 1)(alpha)
if s_alpha > 0:
y.align_data(you_copy)
y.align_data_and_family(you_copy)
f1 = y.family_members_with_points()
f2 = you_copy.family_members_with_points()
for sm1, sm2 in zip(f1, f2):
@ -2827,7 +2827,7 @@ class LoveExample(PiCreatureScene):
)
s_alpha = squish_rate_func(smooth, 0.25, 1)(alpha)
if s_alpha > 0:
t.align_data(tau_copy)
t.align_data_and_family(tau_copy)
f1 = t.family_members_with_points()
f2 = tau_copy.family_members_with_points()
for sm1, sm2 in zip(f1, f2):

View file

@ -588,7 +588,7 @@ class FourierNDQ(FourierOfTrebleClef):
path = VMobject()
shape = TexMobject("NDQ")
for sp in shape.family_members_with_points():
path.append_points(sp.points)
path.append_points(sp.get_points())
return path

View file

@ -471,7 +471,7 @@ class CircleAnimationOfF(FourierOfTrebleClef):
path = VMobject()
shape = TextMobject("F")
for sp in shape.family_members_with_points():
path.append_points(sp.points)
path.append_points(sp.get_points())
return path

View file

@ -186,7 +186,7 @@ class TemperatureGraphScene(SpecialThreeDScene):
axes.x_min,
t_tracker.get_value(),
axes.z_min,
) - plane.points[0]
) - plane.get_points()[0]
))
plane.t_tracker = t_tracker
return plane

View file

@ -253,7 +253,7 @@ class ComplexFourierSeriesExample(FourierOfTrebleClef):
np.clip(alpha - 0.01, 0, 1),
np.clip(alpha, 0, 1),
)
p.points[-1] = vectors[-1].get_end()
p.get_points()[-1] = vectors[-1].get_end()
path.add_updater(update_path)
return path

View file

@ -485,12 +485,12 @@ class TriangleModuliSpace(Scene):
self.wait()
# Adjust triangle
tip_tracker = VectorizedPoint(triangle.points[0])
tip_tracker = VectorizedPoint(triangle.get_points()[0])
def update_triangle(tri):
point = tip_tracker.get_location()
tri.points[0] = point
tri.points[-1] = point
tri.get_points()[0] = point
tri.get_points()[-1] = point
tri.make_jagged()
triangle.add_updater(update_triangle)

View file

@ -1331,7 +1331,7 @@ class ShowSpiralsForWholeNumbers(CountSpirals):
for n, spiral in zip(it.count(1), new_spirals):
count = Integer(n)
count.scale(2)
count.move_to(spiral.points[50])
count.move_to(spiral.get_points()[50])
counts.add(count)
self.remove(curr_spiral)
@ -4907,7 +4907,7 @@ class Thumbnail(SpiralScene):
fill_color=TEAL,
# fill_opacity=interpolate(0.5, 1, min(get_norm(point), 1))
)
for point in p_spiral.points
for point in p_spiral.get_points()
])
dots.set_fill([TEAL_E, TEAL_A])
dots.set_stroke(BLACK, 1)

View file

@ -1412,7 +1412,7 @@ class WindmillScene(Scene):
tips.set_stroke(BLACK, 1, background=True)
for tip, a in zip(tips, np.linspace(0, 1, n_tips)):
tip.shift(
windmill.point_from_proportion(a) - tip.points[0]
windmill.point_from_proportion(a) - tip.get_points()[0]
)
return tips
@ -2972,7 +2972,7 @@ class Rotate180Argument(WindmillScene):
self.wait()
def show_parallel_lines(self):
points = self.points
points = self.get_points()
rotation_label = self.rotation_label
dots = self.dots
windmill = self.windmill

View file

@ -69,7 +69,7 @@ class ConvolutionIntroduction(ThreeDScene):
h, w = kernel.shape
pixels = np.array([
square.fill_rgbas[0]
square.data["fill_rgba"][0]
for square in pixel_array
]).reshape((height, width, 4))
@ -82,7 +82,7 @@ class ConvolutionIntroduction(ThreeDScene):
kernel_array.move_to(pixel_array[pos])
right_rect.move_to(new_array[pos])
new_array[pos].fill_rgbas[0] = rgba
new_array[pos].data["fill_rgba"][0] = rgba
def walk(start, stop, time=5, surface=None):
for n in range(start, stop):

View file

@ -165,7 +165,7 @@ class HighlightReviewParts(Scene):
inv_rects = VGroup()
for rect in rects:
fsr = FullScreenFadeRectangle()
fsr.append_points(rect.points[::-1])
fsr.append_points(rect.get_points()[::-1])
inv_rects.add(fsr)
inv_rects.set_fill(BLACK, 0.85)
@ -1552,7 +1552,7 @@ class LookAtAllPossibleSuccessRates(Scene):
graph = axes.get_graph(dist.pdf)
graph.set_stroke(BLUE, 3)
flat_graph = graph.copy()
flat_graph.points[:, 1] = axes.c2p(0, 0)[1]
flat_graph.get_points()[:, 1] = axes.c2p(0, 0)[1]
flat_graph.set_stroke(YELLOW, 3)
x_labels = axes.x_axis.numbers
@ -1956,14 +1956,9 @@ class RunCarFactory(Scene):
self.add(factory)
# Dumb hack
l1 = Line(
factory[0].points[-200],
factory[0].points[-216],
)
l2 = Line(
factory[0].points[-300],
factory[0].points[-318],
)
points = factory[0].get_points()
l1 = Line(points[-200], points[-216])
l2 = Line(points[-300], points[-318])
for line in l1, l2:
square = Square()
square.set_fill(BLACK, 1)

View file

@ -358,7 +358,6 @@ class ShowInfiniteContinuum(Scene):
# Arrows
arrows = VGroup()
arrow_template = Vector(DOWN)
arrow_template.lock_triangulation()
def get_arrow(s, denom, arrow_template=arrow_template, axes=axes):
arrow = arrow_template.copy()
@ -2078,7 +2077,7 @@ class Thumbnail(Scene):
black_arrow.set_color(BLACK)
black_arrow.set_stroke(width=20)
arrow.points[0] += 0.025 * DR
arrow.get_points()[0] += 0.025 * DR
# Coords
coords = TexMobject("(x, y) = (0.31415\\dots, 0.27182\\dots)")

View file

@ -923,7 +923,6 @@ class VisualizeBayesRule(Scene):
arrows = VGroup()
arrow_template = Vector(DOWN)
arrow_template.lock_triangulation()
def get_arrow(s, denom):
arrow = arrow_template.copy()

View file

@ -96,7 +96,6 @@ class Histogram(Group):
labels = VGroup()
for value in self.y_axis_numbers_to_show:
label = Integer(value, unit="\\%")
fix_percent(label[-1][0])
label.set_height(self.y_axis_label_height)
label.next_to(axes.y_axis.n2p(0.01 * value), LEFT)
labels.add(label)
@ -128,18 +127,6 @@ class Histogram(Group):
# Images of randomness
def fix_percent(sym):
# Really need to make this unneeded...
new_sym = sym.copy()
path_lengths = [len(path) for path in sym.get_subpaths()]
n = sum(path_lengths[:2])
p1 = sym.points[:n]
p2 = sym.points[n:]
sym.points = p1
new_sym.points = p2
sym.add(new_sym)
sym.lock_triangulation()
def get_random_process(choices, shuffle_time=2, total_time=3, change_rate=0.05,
h_buff=0.1, v_buff=0.1):
@ -238,7 +225,6 @@ def get_coin(symbol, color=None):
label.move_to(circ)
coin.add(circ, label)
coin.symbol = symbol
coin.lock_triangulation()
return coin
@ -393,7 +379,6 @@ def close_off_graph(axes, graph):
x_max = axes.x_axis.p2n(graph.get_end())
graph.add_line_to(axes.c2p(x_max, 0))
graph.add_line_to(axes.c2p(0, 0))
graph.lock_triangulation()
return graph
@ -403,7 +388,6 @@ def get_beta_graph(axes, n_plus, n_minus, **kwargs):
close_off_graph(axes, graph)
graph.set_stroke(BLUE, 2)
graph.set_fill(BLUE_E, 1)
graph.lock_triangulation()
return graph

View file

@ -183,7 +183,7 @@ class FlipCoin(Animation):
def interpolate_mobject(self, alpha):
coin = self.mobject
for sm, start_sm in self.families:
sm.points[:] = start_sm.points
sm.match_points(start_sm)
coin.rotate(alpha * PI, axis=self.axis)
coin.shift(4 * alpha * (1 - alpha) * self.shift_vect)
return coin
@ -4018,9 +4018,9 @@ class FourDCubeColoringFromTrees(ThreeDScene):
])
vertex_holder.center()
if dim == 4:
vertex_holder.points[8:] *= 2
vertex_holder.get_points()[8:] *= 2
vertex_holder.set_width(width)
return vertex_holder.points
return vertex_holder.get_points()
class IntroduceHypercube(FourDCubeColoringFromTrees):

View file

@ -19,8 +19,8 @@ def get_baby_monster():
def blink_monster(monster):
monster.generate_target()
left_eye_points = monster.target[0].points[498:528]
right_eye_points = monster.target[0].points[582:612]
left_eye_points = monster.target[0].get_points()[498:528]
right_eye_points = monster.target[0].get_points()[582:612]
for points in left_eye_points, right_eye_points:
points[:, 1] = points[0, 1]
return MoveToTarget(monster, rate_func=squish_rate_func(there_and_back, 0.4, 0.6))
@ -63,7 +63,7 @@ def get_cube(color=BLUE_D, opacity=1, height=2, frame=None):
for face, p_face in zip(cube, poor_cube):
face.add(*[
Line3D(p_face.points[i], p_face.points[j], width=0.02, color=GREY_B)
Line3D(p_face.get_points()[i], p_face.get_points()[j], width=0.02, color=GREY_B)
for i, j in [(0, 1), (1, 3), (3, 2), (2, 0)]
])
@ -2761,7 +2761,7 @@ class AskAboutCubeDiagonals(QuadrupletShufflings):
for diag in diagonals:
globals()['diag'] = diag
Group(*[
cds[np.argmin([get_norm(cd.get_center() - diag.points[i]) for cd in cds])]
cds[np.argmin([get_norm(cd.get_center() - diag.get_points()[i]) for cd in cds])]
for i in [0, -1]
]).match_color(diag)

View file

@ -238,7 +238,7 @@ class Person(VGroup):
self.pop_anim(anim)
def get_center(self):
return self.center_point.points[0]
return self.center_point.get_points()[0]
class DotPerson(Person):
@ -3050,7 +3050,6 @@ class WideSpreadTesting(Scene):
class VirusSpreading(Scene):
def construct(self):
virus = SVGMobject(file_name="virus")
virus.lock_triangulation()
virus.set_fill(RED_E, 1)
virus.set_stroke([RED, WHITE], width=0)
height = 3

View file

@ -70,10 +70,10 @@ class PiCreature(SVGMobject):
if self.start_corner is not None:
self.to_corner(self.start_corner)
def align_data(self, mobject):
def align_data_and_family(self, mobject):
# This ensures that after a transform into a different mode,
# the pi creatures mode will be updated appropriately
SVGMobject.align_data(self, mobject)
SVGMobject.align_data_and_family(self, mobject)
if isinstance(mobject, PiCreature):
self.mode = mobject.get_mode()
@ -139,9 +139,11 @@ class PiCreature(SVGMobject):
def set_color(self, color):
self.body.set_fill(color)
self.color = color
return self
def get_color(self):
return self.body.get_color()
def change_mode(self, mode):
new_self = self.__class__(mode=mode)
new_self.match_style(self)
@ -206,7 +208,7 @@ class PiCreature(SVGMobject):
eye_bottom_y = eye_parts.get_y(DOWN)
for eye_part in eye_parts.family_members_with_points():
eye_part.points[:, 1] = eye_bottom_y
eye_part.get_points()[:, 1] = eye_bottom_y
return self
@ -240,9 +242,10 @@ class PiCreature(SVGMobject):
def shrug(self):
self.change_mode("shruggie")
points = self.mouth.get_points()
top_mouth_point, bottom_mouth_point = [
self.mouth.points[np.argmax(self.mouth.points[:, 1])],
self.mouth.points[np.argmin(self.mouth.points[:, 1])]
points[np.argmax(points[:, 1])],
points[np.argmin(points[:, 1])]
]
self.look(top_mouth_point - bottom_mouth_point)
return self

View file

@ -174,9 +174,9 @@ class Logo(VMobject):
])
for sector in new_pupil:
sector.add_cubic_bezier_curve_to([
sector.points[-1],
sector.get_points()[-1],
*[center] * 3,
*[sector.points[0]] * 2
*[sector.get_points()[0]] * 2
])
self.remove(pupil)
self.add(new_pupil)
@ -243,7 +243,7 @@ class LogoGeneration(LogoGenerationTemplate):
for layer in layers:
for spike in layer:
spike.save_state()
point = np.array(spike.points[0])
point = np.array(spike.get_points()[0])
angle = angle_of_vector(point)
spike.rotate(-angle + 90 * DEGREES)
spike.stretch_to_fit_width(0.2)
@ -318,11 +318,11 @@ class SortingLogoGeneration(LogoGenerationTemplate):
spike.angle,
about_point=ORIGIN
)
# spike.points[1] = rotate_vector(
# spike.points[1], TAU/28,
# spike.get_points()[1] = rotate_vector(
# spike.get_points()[1], TAU/28,
# )
# spike.points[-1] = rotate_vector(
# spike.points[-1], -TAU/28,
# spike.get_points()[-1] = rotate_vector(
# spike.get_points()[-1], -TAU/28,
# )
def get_spike_animation(spike, **kwargs):