mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Add an option for VMobject.add_line to add a null line
This commit is contained in:
parent
c83d03aeb7
commit
b3386ad7a7
2 changed files with 3 additions and 3 deletions
|
@ -687,7 +687,7 @@ class Arrow(Line):
|
|||
if self.path_arc > 0 and self.buff > 0:
|
||||
self.insert_n_curves(10) # Is this needed?
|
||||
self.pointwise_become_partial(self, 0.0, 1.0 - alpha)
|
||||
self.add_line_to(self.get_end())
|
||||
self.add_line_to(self.get_end(), allow_null_line=True)
|
||||
self.add_line_to(prev_end)
|
||||
self.n_tip_points = 3
|
||||
return self
|
||||
|
|
|
@ -513,10 +513,10 @@ class VMobject(Mobject):
|
|||
self.append_points([handle, anchor])
|
||||
return self
|
||||
|
||||
def add_line_to(self, point: Vect3) -> Self:
|
||||
def add_line_to(self, point: Vect3, allow_null_line: bool = False) -> Self:
|
||||
self.throw_error_if_no_points()
|
||||
last_point = self.get_last_point()
|
||||
if self.consider_points_equal(last_point, point):
|
||||
if not allow_null_line and self.consider_points_equal(last_point, point):
|
||||
return self
|
||||
alphas = np.linspace(0, 1, 5 if self.long_lines else 3)
|
||||
self.append_points(outer_interpolate(last_point, point, alphas[1:]))
|
||||
|
|
Loading…
Add table
Reference in a new issue