Default SVG paths and dots to have locked triangulation

This commit is contained in:
Grant Sanderson 2020-02-13 11:56:39 -08:00
parent 095a3ef28c
commit c780a7471b
3 changed files with 5 additions and 4 deletions

View file

@ -1,4 +1,3 @@
import warnings
import numpy as np
from manimlib.constants import *
@ -13,7 +12,6 @@ from manimlib.utils.simple_functions import fdiv
from manimlib.utils.space_ops import angle_of_vector
from manimlib.utils.space_ops import angle_between_vectors
from manimlib.utils.space_ops import compass_directions
from manimlib.utils.space_ops import line_intersection
from manimlib.utils.space_ops import find_intersection
from manimlib.utils.space_ops import get_norm
from manimlib.utils.space_ops import normalize
@ -317,6 +315,7 @@ class Dot(Circle):
def __init__(self, point=ORIGIN, **kwargs):
Circle.__init__(self, arc_center=point, **kwargs)
self.lock_triangulation()
class SmallDot(Dot):

View file

@ -316,7 +316,7 @@ class SVGMobject(VMobject):
class VMobjectFromSVGPathstring(VMobject):
def __init__(self, path_string, **kwargs):
digest_locals(self)
self.path_string = path_string
VMobject.__init__(self, **kwargs)
def init_points(self):
@ -328,6 +328,8 @@ class VMobjectFromSVGPathstring(VMobject):
self.subdivide_sharp_curves()
# SVG treats y-coordinate differently
self.stretch(-1, 1, about_point=ORIGIN)
# For faster rendering
self.lock_triangulation()
def get_commands_and_coord_strings(self):
all_commands = list(self.get_command_to_function_map().keys())

View file

@ -56,11 +56,11 @@ class VMobject(Mobject):
# Could also be Bevel, Miter, Round
"joint_type": "auto",
"render_primative": moderngl.TRIANGLES,
"triangulation_locked": False,
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.triangulation_locked = False
def get_group_class(self):
return VGroup