diff --git a/manimlib/animation/creation.py b/manimlib/animation/creation.py index 4ad116bd..66716df8 100644 --- a/manimlib/animation/creation.py +++ b/manimlib/animation/creation.py @@ -136,7 +136,6 @@ class DrawBorderThenFill(Animation): if index == 1 and self.sm_to_index[hash(submob)] == 0: # First time crossing over submob.set_data(outline.data) - submob.needs_new_triangulation = False self.sm_to_index[hash(submob)] = 1 if index == 0: diff --git a/manimlib/mobject/geometry.py b/manimlib/mobject/geometry.py index a8b665d7..d418271b 100644 --- a/manimlib/mobject/geometry.py +++ b/manimlib/mobject/geometry.py @@ -448,12 +448,8 @@ class Annulus(VMobject): ) self.radius = outer_radius - # Make sure to add enough components that triangulation doesn't fail - kw = dict( - n_components=int(max(8, np.ceil(TAU / math.acos(inner_radius / outer_radius)))) - ) - outer_path = outer_radius * Arc.create_quadratic_bezier_points(TAU, 0, **kw) - inner_path = inner_radius * Arc.create_quadratic_bezier_points(-TAU, 0, **kw) + outer_path = outer_radius * Arc.create_quadratic_bezier_points(TAU, 0) + inner_path = inner_radius * Arc.create_quadratic_bezier_points(-TAU, 0) self.add_subpath(outer_path) self.add_subpath(inner_path) self.shift(center) diff --git a/manimlib/mobject/svg/drawings.py b/manimlib/mobject/svg/drawings.py index 6c02175b..0f2764a3 100644 --- a/manimlib/mobject/svg/drawings.py +++ b/manimlib/mobject/svg/drawings.py @@ -383,7 +383,6 @@ class Bubble(SVGMobject): self.flip() self.content = Mobject() - self.refresh_triangulation() def get_tip(self): # TODO, find a better way diff --git a/manimlib/mobject/svg/svg_mobject.py b/manimlib/mobject/svg/svg_mobject.py index cf921085..bd0d1341 100644 --- a/manimlib/mobject/svg/svg_mobject.py +++ b/manimlib/mobject/svg/svg_mobject.py @@ -319,8 +319,6 @@ class VMobjectFromSVGPath(VMobject): if self.should_remove_null_curves: # Get rid of any null curves self.set_points(self.get_points_without_null_curves()) - # So triangulation doesn't get messed up - self.subdivide_intersections() # Save for future use PATH_TO_POINTS[path_string] = self.get_points().copy() else: diff --git a/manimlib/mobject/types/vectorized_mobject.py b/manimlib/mobject/types/vectorized_mobject.py index f7b58f34..f3b569c4 100644 --- a/manimlib/mobject/types/vectorized_mobject.py +++ b/manimlib/mobject/types/vectorized_mobject.py @@ -459,6 +459,8 @@ class VMobject(Mobject): def use_winding_fill(self, value: bool = True, recurse: bool = True): for submob in self.get_family(recurse): submob._use_winding_fill = value + if not value: + submob.subdivide_intersections() return self # Points @@ -899,8 +901,11 @@ class VMobject(Mobject): # If both have fill, and they have the same shape, just # give them the same triangulation so that it's not recalculated # needlessly throughout an animation - if not self._use_winding_fill and self.has_fill() \ - and vmobject.has_fill() and self.has_same_shape_as(vmobject): + match_tris = not self._use_winding_fill and \ + self.has_fill() and \ + vmobject.has_fill() and \ + self.has_same_shape_as(vmobject) + if match_tris: vmobject.triangulation = self.triangulation return self @@ -921,8 +926,7 @@ class VMobject(Mobject): def get_nth_subpath(path_list, n): if n >= len(path_list): - # Create a null path at the very end - return [path_list[-1][-1]] * 3 + return [path_list[-1][-1]] return path_list[n] for n in range(n_subpaths):