Beispiel #1
0
    def test_anticlockwise_polygon_winding(self):
        """Tests the algorithm returns False (anti-clockwise) for an anti-clockwise polygon."""

        poly = np.array([[1, 1], [1, 2], [2, 2], [2, 1]], dtype=np.double)
        poly = np.array(poly[::-1])
        self.assertFalse(winding2d(poly))
Beispiel #2
0
    def test_anticlockwise_polygon_winding(self):
        """Tests the algorithm returns False (anti-clockwise) for an anti-clockwise polygon."""

        poly = np.array([[1, 1], [1, 2], [2, 2], [2, 1]], dtype=np.double)
        poly = np.array(poly[::-1])
        self.assertFalse(winding2d(poly))
Beispiel #3
0
    def test_clockwise_polygon_winding(self):
        """Tests the algorithm returns True (clockwise) for a clockwise polygon."""

        poly = np.array([[1, 1], [1, 2], [2, 2], [2, 1]], dtype=np.double)
        self.assertTrue(winding2d(poly))
Beispiel #4
0
    def test_clockwise_polygon_winding(self):
        """Tests the algorithm returns True (clockwise) for a clockwise polygon."""

        poly = np.array([[1, 1], [1, 2], [2, 2], [2, 1]], dtype=np.double)
        self.assertTrue(winding2d(poly))