Fixed flashing 3d dot problem

This commit is contained in:
Grant Sanderson
2018-09-04 16:14:39 -07:00
parent 405d566aa9
commit 5b9ae8ddb3

View File

@ -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)