mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 19:46:21 +08:00
Handle make_jagged for empty VMobjects
This commit is contained in:
@ -457,6 +457,9 @@ class VMobject(Mobject):
|
||||
anchors: Vect3Array,
|
||||
handles: Vect3Array,
|
||||
) -> Self:
|
||||
if len(anchors) == 0:
|
||||
self.clear_points()
|
||||
return self
|
||||
assert(len(anchors) == len(handles) + 1)
|
||||
points = resize_array(self.get_points(), 2 * len(anchors) - 1)
|
||||
points[0::2] = anchors
|
||||
@ -644,6 +647,8 @@ class VMobject(Mobject):
|
||||
|
||||
def change_anchor_mode(self, mode: str) -> Self:
|
||||
assert(mode in ("jagged", "approx_smooth", "true_smooth"))
|
||||
if self.get_num_points() == 0:
|
||||
return self
|
||||
subpaths = self.get_subpaths()
|
||||
self.clear_points()
|
||||
for subpath in subpaths:
|
||||
|
Reference in New Issue
Block a user