示例#1
0
 def testInDent(self):
     position = [1.0, 1.0]
     polygon = [[0.0, 0.0], [2.0, 1.0], [0.0, 2.0], [4.0, 2.0], [3.0, 0.0],
                [0.0, 0.0]]
     self.assertFalse(skurt_challenge.insideRange(position, polygon))
示例#2
0
 def testWeirdShape(self):
     position = [1.5, 0.5]
     polygon = [[0.0, 0.0], [0.0, 2.0], [2.0, 2.0], [2.0, 1.0], [3.0, 1.0],
                [3.0, -1.0], [1.0, -1.0], [1.0, 0.0], [1.0, 1.0],
                [2.0, 1.0], [2.0, 0.0], [1.0, 0.0], [0.0, 0.0]]
     self.assertFalse(skurt_challenge.insideRange(position, polygon))
示例#3
0
 def testAtVertex(self):
     position = [2.0, 2.0]
     polygon = [[0.0, 0.0], [2.0, 2.0], [4.0, 0.0], [0.0, 0.0]]
     self.assertTrue(skurt_challenge.insideRange(position, polygon))
示例#4
0
 def testDiagonal(self):
     position = [1.0, 1.0]
     polygon = [[0.0, 0.0], [2.0, 2.0], [4.0, 0.0], [0.0, 0.0]]
     self.assertTrue(skurt_challenge.insideRange(position, polygon))