First scene of eoc/chapter3

This commit is contained in:
Grant Sanderson
2017-01-25 13:00:01 -08:00
parent 2930c094f1
commit 694297d4ad
5 changed files with 311 additions and 47 deletions

View File

@ -345,14 +345,16 @@ class VMobject(Mobject):
return self
self.mark_paths_closed = False
num_cubics = mobject.get_num_anchor_points()-1
lower_index = int(a*num_cubics)
upper_index = int(b*num_cubics)
lower_index = np.floor(a*num_cubics)
upper_index = np.ceil(b*num_cubics)
points = np.array(
mobject.points[3*lower_index:3*upper_index+4]
)
if len(points) > 1:
a_residue = (num_cubics*a)%1
b_residue = (num_cubics*b)%1
if b == 1:
b_residue = 1
points[:4] = partial_bezier_points(
points[:4], a_residue, 1
)