コード例 #1
0
ファイル: Point3.py プロジェクト: may3rd/Image2CAD
 def CalculateNormal(first, second, third):
     v1 = Vector3(second.x - first.x, second.y - first.y,
                  second.z - first.z)
     v2 = Vector3(third.x - second.x, third.y - second.y,
                  third.z - second.z)
     normal = v1.Cross(v2)
     normal.Normalize()
     return normal
コード例 #2
0
ファイル: Point2.py プロジェクト: adityaintwala/Image2CAD
 def AreCollinear(first, second, third):
     if (first == second or first == third or second == third):
         return True
     v1 = Vector3(first.x - second.x, first.y - second.y, 0)
     v2 = Vector3(first.x - third.x, first.y - third.y, 0)
     angle = Vector3.AngleDeg(v1,v2)
     if ((fabs(angle) < Constants.PRECISION) or (fabs(angle - 180) < Constants.PRECISION)):
         return True
     return False
コード例 #3
0
ファイル: Point3.py プロジェクト: may3rd/Image2CAD
 def __sub__(self, other):
     return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
コード例 #4
0
ファイル: Point2.py プロジェクト: adityaintwala/Image2CAD
 def CalculateNormal (first, second, third):
     v1 = Vector3.Vector3( second.x - first.x, second.y - first.y, 0)
     normal = Vector3.Vector3(v1.y, -v1.x, 0)
     normal.Normalize()
     return print('Normal Vector', normal)