mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Handle edge case of single point passed into approx_smooth_quadratic_bezier_handles
This commit is contained in:
parent
0dcf630222
commit
e130625b9b
1 changed files with 3 additions and 1 deletions
|
@ -198,7 +198,9 @@ def approx_smooth_quadratic_bezier_handles(
|
|||
another that would produce a parabola passing through P0, call it smooth_to_left,
|
||||
and use the midpoint between the two.
|
||||
"""
|
||||
if len(points) == 2:
|
||||
if len(points) == 1:
|
||||
return points[0]
|
||||
elif len(points) == 2:
|
||||
return midpoint(*points)
|
||||
smooth_to_right, smooth_to_left = [
|
||||
0.25 * ps[0:-2] + ps[1:-1] - 0.25 * ps[2:]
|
||||
|
|
Loading…
Add table
Reference in a new issue