diff --git a/manimlib/mobject/svg/svg_mobject.py b/manimlib/mobject/svg/svg_mobject.py index 2de59192..236d027a 100644 --- a/manimlib/mobject/svg/svg_mobject.py +++ b/manimlib/mobject/svg/svg_mobject.py @@ -325,6 +325,7 @@ class VMobjectFromSVGPathstring(VMobject): CONFIG = { "long_lines": True, "should_subdivide_sharp_curves": False, + "should_remove_null_curves": False, } def __init__(self, path_string, **kwargs): @@ -353,10 +354,11 @@ class VMobjectFromSVGPathstring(VMobject): if self.should_subdivide_sharp_curves: # For a healthy triangulation later self.subdivide_sharp_curves() + if self.should_remove_null_curves: + # Get rid of any null curves + self.points = self.get_points_without_null_curves() # SVG treats y-coordinate differently self.stretch(-1, 1, about_point=ORIGIN) - # Get rid of any null curves - self.points = self.get_points_without_null_curves() # Save to a file for future use np.save(filepath, self.points) diff --git a/manimlib/mobject/svg/tex_mobject.py b/manimlib/mobject/svg/tex_mobject.py index d65757f8..40a7c0a2 100644 --- a/manimlib/mobject/svg/tex_mobject.py +++ b/manimlib/mobject/svg/tex_mobject.py @@ -18,6 +18,7 @@ TEX_MOB_SCALE_FACTOR = 0.05 class TexSymbol(VMobjectFromSVGPathstring): CONFIG = { "should_subdivide_sharp_curves": True, + "should_remove_null_curves": True, }