コード例 #1
0
    def test_seg_contains_cases(self):
        SOL.fresh_solver()
        sb = Segment(p1=Point2D(0,0), p2=Point2D(10,0))
        SOL.add(sb.contains(Point2D(5,0)))
        self.assertIsNotNone(SOL.model())

        SOL.fresh_solver()
        sb = Segment(p1=Point2D(10, 0), p2=Point2D(0, 0))
        SOL.add(sb.contains(Point2D(5, 0)))
        self.assertIsNotNone(SOL.model())

        SOL.fresh_solver()
        sb = Segment(p1=Point2D(0, 0), p2=Point2D(0, 10))
        SOL.add(sb.contains(Point2D(0, 5)))
        self.assertIsNotNone(SOL.model())

        SOL.fresh_solver()
        sb = Segment(p1=Point2D(0, 10), p2=Point2D(0, 0))
        SOL.add(sb.contains(Point2D(0, 5)))
        self.assertIsNotNone(SOL.model())
コード例 #2
0
 def setUp(self) -> None:
     SOL.fresh_solver()