diff --git a/manimlib/for_3b1b_videos/pi_creature.py b/manimlib/for_3b1b_videos/pi_creature.py index 457dfa5c..0990298c 100644 --- a/manimlib/for_3b1b_videos/pi_creature.py +++ b/manimlib/for_3b1b_videos/pi_creature.py @@ -149,9 +149,7 @@ class PiCreature(SVGMobject): return self def change_mode(self, mode): - new_self = self.__class__( - mode=mode, - ) + new_self = self.__class__(mode=mode) new_self.match_style(self) new_self.match_height(self) if self.is_flipped() != new_self.is_flipped(): @@ -211,10 +209,11 @@ class PiCreature(SVGMobject): def blink(self): eye_parts = self.eye_parts - eye_bottom_y = eye_parts.get_bottom()[1] - eye_parts.apply_function( - lambda p: [p[0], eye_bottom_y, p[2]] - ) + eye_bottom_y = eye_parts.get_y(DOWN) + + for eye_part in eye_parts: + eye_part.points[:, 1] = eye_bottom_y + return self def to_corner(self, vect=None, **kwargs): diff --git a/manimlib/mobject/svg/svg_mobject.py b/manimlib/mobject/svg/svg_mobject.py index 8385a11b..0538d240 100644 --- a/manimlib/mobject/svg/svg_mobject.py +++ b/manimlib/mobject/svg/svg_mobject.py @@ -322,6 +322,11 @@ class SVGMobject(VMobject): class VMobjectFromSVGPathstring(VMobject): + CONFIG = { + "long_lines": True, + "subdivide_sharp_curves": False, + } + def __init__(self, path_string, **kwargs): self.path_string = path_string VMobject.__init__(self, **kwargs) @@ -345,8 +350,9 @@ class VMobjectFromSVGPathstring(VMobject): for command, coord_string in self.get_commands_and_coord_strings(): new_points = self.string_to_points(command, coord_string) self.handle_command(command, new_points) - # For a healthy triangulation later - self.subdivide_sharp_curves() + if self.subdivide_sharp_curves: + # For a healthy triangulation later + self.subdivide_sharp_curves() # SVG treats y-coordinate differently self.stretch(-1, 1, about_point=ORIGIN) # Save to a file for future use diff --git a/manimlib/mobject/svg/tex_mobject.py b/manimlib/mobject/svg/tex_mobject.py index 60b299e6..e701a644 100644 --- a/manimlib/mobject/svg/tex_mobject.py +++ b/manimlib/mobject/svg/tex_mobject.py @@ -16,10 +16,9 @@ TEX_MOB_SCALE_FACTOR = 0.05 class TexSymbol(VMobjectFromSVGPathstring): - """ - Purely a renaming of VMobjectFromSVGPathstring - """ - pass + CONFIG = { + "subdivide_sharp_curves": True, + } class SingleStringTexMobject(SVGMobject):