From 5b9ae8ddb3081374d58d38bc23f64c25bc46ec8a Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Tue, 4 Sep 2018 16:14:39 -0700 Subject: [PATCH] Fixed flashing 3d dot problem --- mobject/three_d_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mobject/three_d_utils.py b/mobject/three_d_utils.py index b0649f6b..187aad27 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)