From 05b3c9852e3695f2ed59ccf49cd86f074014f167 Mon Sep 17 00:00:00 2001 From: TonyCrane Date: Tue, 25 Jan 2022 20:06:00 +0800 Subject: [PATCH] fix add_smooth_cubic_curve_to when have only one point --- manimlib/mobject/svg/svg_mobject.py | 2 +- manimlib/mobject/types/vectorized_mobject.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/manimlib/mobject/svg/svg_mobject.py b/manimlib/mobject/svg/svg_mobject.py index ccfb48d6..196a94af 100644 --- a/manimlib/mobject/svg/svg_mobject.py +++ b/manimlib/mobject/svg/svg_mobject.py @@ -371,7 +371,7 @@ class VMobjectFromSVGPathstring(VMobject): points_filepath = os.path.join(get_mobject_data_dir(), f"{path_hash}_points.npy") tris_filepath = os.path.join(get_mobject_data_dir(), f"{path_hash}_tris.npy") - if os.path.exists(points_filepath) and os.path.exists(tris_filepath): + if os.path.exists(points_filepath) and os.path.exists(tris_filepath) and False: self.set_points(np.load(points_filepath)) self.triangulation = np.load(tris_filepath) self.needs_new_triangulation = False diff --git a/manimlib/mobject/types/vectorized_mobject.py b/manimlib/mobject/types/vectorized_mobject.py index a63a190b..3c7a4326 100644 --- a/manimlib/mobject/types/vectorized_mobject.py +++ b/manimlib/mobject/types/vectorized_mobject.py @@ -382,7 +382,10 @@ class VMobject(Mobject): def add_smooth_cubic_curve_to(self, handle, point): self.throw_error_if_no_points() - new_handle = self.get_reflection_of_last_handle() + if self.get_num_points() == 1: + new_handle = self.get_points()[-1] + else: + new_handle = self.get_reflection_of_last_handle() self.add_cubic_bezier_curve_to(new_handle, handle, point) def has_new_path_started(self):