mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Only remove null curves for tex mobjects
This commit is contained in:
parent
c8195f72a1
commit
1f6308577b
2 changed files with 5 additions and 2 deletions
|
@ -325,6 +325,7 @@ class VMobjectFromSVGPathstring(VMobject):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"long_lines": True,
|
"long_lines": True,
|
||||||
"should_subdivide_sharp_curves": False,
|
"should_subdivide_sharp_curves": False,
|
||||||
|
"should_remove_null_curves": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, path_string, **kwargs):
|
def __init__(self, path_string, **kwargs):
|
||||||
|
@ -353,10 +354,11 @@ class VMobjectFromSVGPathstring(VMobject):
|
||||||
if self.should_subdivide_sharp_curves:
|
if self.should_subdivide_sharp_curves:
|
||||||
# For a healthy triangulation later
|
# For a healthy triangulation later
|
||||||
self.subdivide_sharp_curves()
|
self.subdivide_sharp_curves()
|
||||||
# SVG treats y-coordinate differently
|
if self.should_remove_null_curves:
|
||||||
self.stretch(-1, 1, about_point=ORIGIN)
|
|
||||||
# Get rid of any null curves
|
# Get rid of any null curves
|
||||||
self.points = self.get_points_without_null_curves()
|
self.points = self.get_points_without_null_curves()
|
||||||
|
# SVG treats y-coordinate differently
|
||||||
|
self.stretch(-1, 1, about_point=ORIGIN)
|
||||||
# Save to a file for future use
|
# Save to a file for future use
|
||||||
np.save(filepath, self.points)
|
np.save(filepath, self.points)
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ TEX_MOB_SCALE_FACTOR = 0.05
|
||||||
class TexSymbol(VMobjectFromSVGPathstring):
|
class TexSymbol(VMobjectFromSVGPathstring):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"should_subdivide_sharp_curves": True,
|
"should_subdivide_sharp_curves": True,
|
||||||
|
"should_remove_null_curves": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue