mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 14:03:59 +08:00
Use only anchors to compute area vector
This commit is contained in:
@ -758,9 +758,10 @@ class VMobject(Mobject):
|
|||||||
if not self.has_points():
|
if not self.has_points():
|
||||||
return np.zeros(3)
|
return np.zeros(3)
|
||||||
|
|
||||||
|
nppc = self.n_points_per_curve
|
||||||
points = self.get_points()
|
points = self.get_points()
|
||||||
p0 = points[:-1]
|
p0 = points[0::nppc]
|
||||||
p1 = points[1:]
|
p1 = points[nppc - 1::nppc]
|
||||||
|
|
||||||
# Each term goes through all edges [(x1, y1, z1), (x2, y2, z2)]
|
# Each term goes through all edges [(x1, y1, z1), (x2, y2, z2)]
|
||||||
return 0.5 * np.array([
|
return 0.5 * np.array([
|
||||||
@ -1023,10 +1024,9 @@ class VMobject(Mobject):
|
|||||||
super().set_points(points)
|
super().set_points(points)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@triggers_refreshed_triangulation
|
||||||
def append_points(self, points: Vect3Array):
|
def append_points(self, points: Vect3Array):
|
||||||
super().append_points(points)
|
super().append_points(points)
|
||||||
self.refresh_unit_normal()
|
|
||||||
self.refresh_triangulation()
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@triggers_refreshed_triangulation
|
@triggers_refreshed_triangulation
|
||||||
|
Reference in New Issue
Block a user