Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed multiple arrow heads with DashedVMobject #4078

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
18 changes: 18 additions & 0 deletions manim/mobject/geometry/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ def has_start_tip(self) -> bool:
# Getters

def pop_tips(self) -> VGroup:
"""Removes the tips of the arrow,
if there are no tips to return, does nothing
"""
if not self.has_tip() and not self.has_start_tip():
return self.get_group_class()()
start, end = self.get_start_and_end()
result = self.get_group_class()()
if self.has_tip():
Expand Down Expand Up @@ -298,6 +303,19 @@ def get_length(self) -> float:
start, end = self.get_start_and_end()
return float(np.linalg.norm(start - end))

def pointwise_become_partial(
self,
vmobject: VMobject,
a: float,
b: float,
) -> Self:
super().pointwise_become_partial(vmobject, a, b)
"""In case of a dashed object, removes all the excess tips created by each individual dash."""
if self.has_tip() and a != 0:
"""Does the removal of the tip for a particular TipableVMobject"""
self.remove(self.tip)
return self


class Arc(TipableVMobject):
"""A circular arc.
Expand Down
1 change: 0 additions & 1 deletion manim/mobject/types/vectorized_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,6 @@ def pointwise_become_partial(
0,
upper_residue,
)

return self

def get_subcurve(self, a: float, b: float) -> Self:
Expand Down
Loading