예제 #1
0
    def test_tolerance_outside(self):
        p1, p2, p3 = self.setup_close(-1e-6)

        # Safety margin saves ut
        assert cg.is_ccw_polyline(p1, p2, p3, tol=1e-4, default=True)

        # Default kills us, even though we're inside safety margin
        assert not cg.is_ccw_polyline(p1, p2, p3, tol=1e-4, default=False)

        # Outside safety margin, and not on the ccw side
        assert not cg.is_ccw_polyline(p1, p2, p3, tol=1e-8, default=False)
예제 #2
0
 def test_is_ccw(self):
     p1, p2, p3 = self.setup()
     assert cg.is_ccw_polyline(p1, p2, p3)
예제 #3
0
 def test_not_ccw(self):
     p1, p2, p3 = self.setup()
     assert not cg.is_ccw_polyline(p1, p3, p2)
예제 #4
0
 def test_is_ccw(self):
     p1, p2, p3 = self.setup()
     self.assertTrue(cg.is_ccw_polyline(p1, p2, p3))