Author: Not specified Language: python
Description: Not specified Timestamp: 2018-06-04 04:24:13 +0000
View raw paste Reply
  1. def findNearestNormal(self, k_point, neighbords):
  2.         minAngle = 99999
  3.         j = 0
  4.         k_normal = self.meshNormals[k_point]
  5.         if abs(np.linalg.norm(k_normal)) > 0.0000001:
  6.             k_normal = k_normal/np.linalg.norm(k_normal)
  7.         for i in neighbords:
  8.             neig_normal = self.baseNormals[i]
  9.             if abs(np.linalg.norm(neig_normal)) > 0.0000001:
  10.                 dot_p = math.acos(k_normal.dot(neig_normal/np.linalg.norm(neig_normal)))
  11.                 if dot_p < minAngle:
  12.                     j = i
  13.                     maxAngle = dot_p
  14.                
  15.         return j
View raw paste Reply