mirror of
https://github.com/3b1b/manim.git
synced 2025-08-19 21:08:53 +00:00
Fixed edge case in inserting n curves for null curves
This commit is contained in:
parent
b0b71910a5
commit
49d84fccde
1 changed files with 6 additions and 2 deletions
|
@ -710,7 +710,11 @@ class VMobject(Mobject):
|
||||||
get_norm(bg[nppc - 1] - bg[0])
|
get_norm(bg[nppc - 1] - bg[0])
|
||||||
for bg in bezier_groups
|
for bg in bezier_groups
|
||||||
])
|
])
|
||||||
# Insertions per curve
|
total_norm = sum(norms)
|
||||||
|
# Calculate insertions per curve (ipc)
|
||||||
|
if total_norm < 1e-6:
|
||||||
|
ipc = [n] + [0] * (len(bezier_groups) - 1)
|
||||||
|
else:
|
||||||
ipc = np.round(n * norms / sum(norms)).astype(int)
|
ipc = np.round(n * norms / sum(norms)).astype(int)
|
||||||
diff = n - sum(ipc)
|
diff = n - sum(ipc)
|
||||||
for x in range(diff):
|
for x in range(diff):
|
||||||
|
|
Loading…
Add table
Reference in a new issue