mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
fix add_smooth_cubic_curve_to when have only one point
This commit is contained in:
parent
925f2e123f
commit
05b3c9852e
2 changed files with 5 additions and 2 deletions
|
@ -371,7 +371,7 @@ class VMobjectFromSVGPathstring(VMobject):
|
||||||
points_filepath = os.path.join(get_mobject_data_dir(), f"{path_hash}_points.npy")
|
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")
|
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.set_points(np.load(points_filepath))
|
||||||
self.triangulation = np.load(tris_filepath)
|
self.triangulation = np.load(tris_filepath)
|
||||||
self.needs_new_triangulation = False
|
self.needs_new_triangulation = False
|
||||||
|
|
|
@ -382,7 +382,10 @@ class VMobject(Mobject):
|
||||||
|
|
||||||
def add_smooth_cubic_curve_to(self, handle, point):
|
def add_smooth_cubic_curve_to(self, handle, point):
|
||||||
self.throw_error_if_no_points()
|
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)
|
self.add_cubic_bezier_curve_to(new_handle, handle, point)
|
||||||
|
|
||||||
def has_new_path_started(self):
|
def has_new_path_started(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue