mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 19:46:21 +08:00
Merge pull request #1592 from AStarySky/patch-1
fix put_start_and_end_on
This commit is contained in:
@ -830,7 +830,6 @@ class Mobject(object):
|
||||
return self
|
||||
|
||||
def put_start_and_end_on(self, start, end):
|
||||
# TODO, this doesn't currently work in 3d
|
||||
curr_start, curr_end = self.get_start_and_end()
|
||||
curr_vect = curr_end - curr_start
|
||||
if np.all(curr_vect == 0):
|
||||
@ -842,9 +841,12 @@ class Mobject(object):
|
||||
)
|
||||
self.rotate(
|
||||
angle_of_vector(target_vect) - angle_of_vector(curr_vect),
|
||||
about_point=curr_start
|
||||
)
|
||||
self.shift(start - curr_start)
|
||||
self.rotate(
|
||||
np.arctan2(curr_vect[2], get_norm(curr_vect[:2])) - np.arctan2(target_vect[2], get_norm(target_vect[:2])),
|
||||
axis = np.array([-target_vect[1], target_vect[0], 0]),
|
||||
)
|
||||
self.shift(start - self.get_start())
|
||||
return self
|
||||
|
||||
# Color functions
|
||||
|
Reference in New Issue
Block a user