From 2dac0410068229c892f386302cfa94e7f38ce537 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 20 Aug 2020 17:16:15 -0700 Subject: [PATCH] Change default smoothing algorithm --- manimlib/mobject/types/vectorized_mobject.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manimlib/mobject/types/vectorized_mobject.py b/manimlib/mobject/types/vectorized_mobject.py index cb32407d..2dad8f2e 100644 --- a/manimlib/mobject/types/vectorized_mobject.py +++ b/manimlib/mobject/types/vectorized_mobject.py @@ -521,9 +521,13 @@ class VMobject(Mobject): anchors = np.vstack([subpath[::nppc], subpath[-1:]]) new_subpath = np.array(subpath) if mode == "smooth": - new_subpath[1::nppc] = get_smooth_quadratic_bezier_handle_points(anchors) - # h1, h2 = get_smooth_cubic_bezier_handle_points(anchors) - # new_subpath = get_quadratic_approximation_of_cubic(anchors[:-1], h1, h2, anchors[1:]) + # TOOD, it's not clear which of the two options below should be the default, + # leaving option 1 here commented out as a temporary note. + # Option 1: + # new_subpath[1::nppc] = get_smooth_quadratic_bezier_handle_points(anchors) + # Option 2: + h1, h2 = get_smooth_cubic_bezier_handle_points(anchors) + new_subpath = get_quadratic_approximation_of_cubic(anchors[:-1], h1, h2, anchors[1:]) elif mode == "jagged": new_subpath[1::nppc] = 0.5 * (anchors[:-1] + anchors[1:]) submob.append_points(new_subpath)