mirror of
https://github.com/3b1b/manim.git
synced 2025-08-19 13:01:00 +00:00
Update calculation of path ends to not include adjacent pairs
This commit is contained in:
parent
90ac1fc0bf
commit
3f2fd5b142
1 changed files with 7 additions and 3 deletions
|
@ -700,9 +700,13 @@ class VMobject(Mobject):
|
|||
# To disambiguate this from cases with many null
|
||||
# curves in a row, we also check that the following
|
||||
# anchor is genuinely distinct
|
||||
is_end = (a0 == h).all(1) & (abs(h - a1) > atol).any(1)
|
||||
inner_ends = (2 * n for n, end in enumerate(is_end) if end)
|
||||
return np.array([*inner_ends, len(points) - 1])
|
||||
is_end = np.empty(len(points) // 2 + 1, dtype=bool)
|
||||
is_end[:-1] = (a0 == h).all(1) & (abs(h - a1) > atol).any(1)
|
||||
is_end[-1] = True
|
||||
# If the curve immediately after an end marker is also an
|
||||
# end marker, don't mark the second one
|
||||
is_end[:-1] = is_end[:-1] & ~is_end[1:]
|
||||
return np.array([2 * n for n, end in enumerate(is_end) if end])
|
||||
|
||||
def get_subpath_end_indices(self):
|
||||
return self.get_subpath_end_indices_from_points(self.get_points())
|
||||
|
|
Loading…
Add table
Reference in a new issue