Esempio n. 1
0
 def test_0triangle_point(self):
     evt = compute_event(self.tri)
     assert evt != None
     assert evt.time == 4.2814700223784747
     assert evt.how == "point"
     assert evt.event_tp == "collapse"
     assert evt.where == (2.281470064911059, 0.0)
Esempio n. 2
0
 def test_0triangle_spoke(self):
     evt = compute_event(self.tri)
     assert evt != None
     assert evt.time == 0.25
     assert evt.event_tp == "flip"
     assert evt.how == "--"
     assert evt.where == None
Esempio n. 3
0
 def test_1triangle_collapse(self):
     evt = compute_event(self.tri, now=0.)
     assert evt != None
     print "**", evt
     print self.tri.str_at(0)
     assert evt.event_tp == "collapse"
     assert evt.how == "line"
Esempio n. 4
0
 def test_0triangle_segment(self):
     evt = compute_event(self.tri)
     assert evt != None
     assert evt.time == 5.
     assert evt.how == "line"
     assert evt.event_tp == "collapse"
     assert evt.where != None
Esempio n. 5
0
 def test_3triangle(self):
     tri = self.triangles[139742234434064]
     evt = compute_event(tri, now=0.)
     logging.debug(evt)
     logging.info(evt)
     assert orient2d(*[v.position_at(4) for v in tri.vertices]) >= 0
     assert evt.time == 4.281470067903971
Esempio n. 6
0
 def test_equilateral(self):
     evt = compute_event(self.tri)
     assert evt != None
     assert evt.time == 0.6852753776217848091789620, "{:.25f}".format(
         evt.time)
     assert evt.how == "point"
     assert evt.event_tp == "collapse"
     assert evt.where == (1.5, 0.6852753776217849)
Esempio n. 7
0
 def test_1triangle_flip(self):
     # edge that has to flip == (apex, orig)
     evt = compute_event(self.tri, now=0.)
     assert evt != None
     print evt
     print self.tri.str_at(0)
     assert evt.event_tp == "flip"
     assert evt.sides == (1, )
Esempio n. 8
0
 def test_equilateral_past(self):
     evt = compute_event(self.tri, now=-10.)
     assert evt != None
     # FIXME: WRONG, should be ignored (as is in the past)
     assert evt.time == -0.6852753776217849202012644
Esempio n. 9
0
 def test_equilateral(self):
     evt = compute_event(self.tri, now=0.)
     assert evt != None
     # FIXME: WRONG, should be ignored (as is in the past)
     assert evt.time == None
Esempio n. 10
0
 def test_0triangle_spoke_past(self):
     evt = compute_event(self.tri, now = 5)
     assert evt != None
     assert evt.time == None
Esempio n. 11
0
 def test_1triangle_split(self):
     evt = compute_event(self.tri, now=0.)
     assert evt != None
     print evt
     assert evt.event_tp == "split"
Esempio n. 12
0
 def test_inf_triangle_a(self):
     evt = compute_event(self.triangles[139742234434000])  #, now=0.)
     print evt
     assert evt.time == None
Esempio n. 13
0
 def test_3triangle_past(self):
     tri = self.triangles[139742234434064]
     evt = compute_event(tri, now=5.)
     logging.debug(evt)
     logging.info(evt)
     assert evt.time == None