mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Bug fix to refresh_triangulation
This commit is contained in:
parent
f4776626e4
commit
3cc9bf7052
1 changed files with 10 additions and 8 deletions
|
@ -912,12 +912,13 @@ class VMobject(Mobject):
|
||||||
data['joint_type'] = joint_type_to_code[self.joint_type]
|
data['joint_type'] = joint_type_to_code[self.joint_type]
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def lock_triangulation(self):
|
def lock_triangulation(self, family=True):
|
||||||
for sm in self.get_family():
|
mobs = self.get_family() if family else [self]
|
||||||
sm.triangulation_locked = False
|
for mob in mobs:
|
||||||
sm.saved_triangulation = sm.get_triangulation()
|
mob.triangulation_locked = False
|
||||||
sm.saved_orientation = sm.get_orientation()
|
mob.saved_triangulation = mob.get_triangulation()
|
||||||
sm.triangulation_locked = True
|
mob.saved_orientation = mob.get_orientation()
|
||||||
|
mob.triangulation_locked = True
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def unlock_triangulation(self):
|
def unlock_triangulation(self):
|
||||||
|
@ -925,8 +926,9 @@ class VMobject(Mobject):
|
||||||
sm.triangulation_locked = False
|
sm.triangulation_locked = False
|
||||||
|
|
||||||
def refresh_triangulation(self):
|
def refresh_triangulation(self):
|
||||||
if self.triangulation_locked:
|
for sm in self.get_family():
|
||||||
self.lock_triangulation()
|
if sm.triangulation_locked:
|
||||||
|
sm.lock_triangulation(family=False)
|
||||||
|
|
||||||
def get_signed_polygonal_area(self):
|
def get_signed_polygonal_area(self):
|
||||||
nppc = self.n_points_per_curve
|
nppc = self.n_points_per_curve
|
||||||
|
|
Loading…
Add table
Reference in a new issue