Beispiel #1
0
 def tunniPoint(self):
     """Returns the Tunni point of this Bezier (the intersection of
 the handles)."""
     h1 = Line(self[0], self[1])
     h2 = Line(self[2], self[3])
     i = h1.intersections(h2, limited=False)
     if len(i) < 1: return
     i = i[0].point
     if i.distanceFrom(self[0]) > 5 * self.length:
         return
     else:
         return i
Beispiel #2
0
 def tunniPoint(self):
   """Returns the Tunni point of this Bezier (the intersection of
   the handles)."""
   h1 = Line(self[0], self[1])
   h2 = Line(self[2], self[3])
   i = h1.intersections(h2, limited = False)
   if len(i)<1: return
   i = i[0].point
   if i.distanceFrom(self[0]) > 5 * self.length:
     return
   else:
     return i
 def test_line_line(self):
     l1 = Line(Point(310, 389), Point(453, 222))
     l2 = Line(Point(289, 251), Point(447, 367))
     # Sanity check
     self.assertEqual(len(l1.intersections(l2)), 1)