Only remove null curves for tex mobjects

This commit is contained in:
Grant Sanderson 2020-06-23 14:26:02 -07:00
parent c8195f72a1
commit 1f6308577b
2 changed files with 5 additions and 2 deletions

View file

@ -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)

View file

@ -18,6 +18,7 @@ TEX_MOB_SCALE_FACTOR = 0.05
class TexSymbol(VMobjectFromSVGPathstring):
CONFIG = {
"should_subdivide_sharp_curves": True,
"should_remove_null_curves": True,
}