Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed flashing 3d dot problem

Grant Sanderson5b9ae8ddb308
diff --git a/mobject/three_d_utils.py b/mobject/three_d_utils.py
index b0649f6b3..187aad271 100644
--- a/mobject/three_d_utils.py
+++ b/mobject/three_d_utils.py
@@ -38,11 +38,11 @@ def get_3d_vmob_unit_normal(vmob, point_index):
if len(vmob.get_anchors()) <= 2:
return np.array(UP)
i = point_index
- im1 = i - 1 if i > 0 else (n_points - 2)
- ip1 = i + 1 if i < (n_points - 1) else 1
+ im3 = i - 3 if i > 2 else (n_points - 4)
+ ip3 = i + 3 if i < (n_points - 3) else 3
unit_normal = get_unit_normal(
- vmob.points[ip1] - vmob.points[i],
- vmob.points[im1] - vmob.points[i],
+ vmob.points[ip3] - vmob.points[i],
+ vmob.points[im3] - vmob.points[i],
)
if get_norm(unit_normal) == 0:
return np.array(UP)