mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Revert "Revert back from the needs_new_unit_normal change in favor of recomputation"
This reverts commit d8deec8f81
.
This commit is contained in:
parent
fca7c0609a
commit
b7d473ff43
1 changed files with 4 additions and 2 deletions
|
@ -100,6 +100,7 @@ class VMobject(Mobject):
|
|||
self.flat_stroke = flat_stroke
|
||||
|
||||
self.needs_new_triangulation = True
|
||||
self.needs_new_unit_normal = True
|
||||
self.triangulation = np.zeros(0, dtype='i4')
|
||||
|
||||
super().__init__(**kwargs)
|
||||
|
@ -771,7 +772,7 @@ class VMobject(Mobject):
|
|||
])
|
||||
|
||||
def get_unit_normal(self, recompute: bool = False) -> Vect3:
|
||||
if not recompute:
|
||||
if not self.needs_new_unit_normal and not recompute:
|
||||
return self.data["unit_normal"][0]
|
||||
|
||||
if self.get_num_points() < 3:
|
||||
|
@ -788,11 +789,12 @@ class VMobject(Mobject):
|
|||
points[2] - points[1],
|
||||
)
|
||||
self.data["unit_normal"][:] = normal
|
||||
self.needs_new_unit_normal = False
|
||||
return normal
|
||||
|
||||
def refresh_unit_normal(self):
|
||||
for mob in self.get_family():
|
||||
mob.get_unit_normal(recompute=True)
|
||||
mob.needs_new_unit_normal = True
|
||||
return self
|
||||
|
||||
# Alignment
|
||||
|
|
Loading…
Add table
Reference in a new issue