mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Handle make_jagged for empty VMobjects
This commit is contained in:
parent
f2ad9a70f7
commit
eafd09549d
1 changed files with 5 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue