Beispiel #1
0
    def test_points_inline_midpoint_reverse_direction(self):
        import numpy as np
        from shapeanalysis.process_data import points_inline

        a = np.asarray((0, 2))
        b = np.asarray((0, 1))
        c = np.asarray((0, 0))
        tolerance = 0.1
        actual = points_inline(a, b, c, tolerance)
        self.assertTrue(actual)
Beispiel #2
0
    def test_points_inline_midpoint_on_end_screwed_translated(self):
        import numpy as np
        from shapeanalysis.process_data import points_inline

        a = np.asarray((1, 1))
        b = np.asarray((2, 2))
        c = np.asarray((2, 2))
        tolerance = 0.1
        actual = points_inline(a, b, c, tolerance)
        self.assertTrue(actual)
Beispiel #3
0
    def test_points_inline_but_out_of_segment_reversed(self):
        import numpy as np
        from shapeanalysis.process_data import points_inline

        a = np.asarray((2, 2))
        b = np.asarray((2, 2.1))
        c = np.asarray((1, 1))
        tolerance = 0.5
        actual = points_inline(a, b, c, tolerance)
        self.assertFalse(actual)
Beispiel #4
0
    def test_points_inline_line_offset(self):
        import numpy as np
        from shapeanalysis.process_data import points_inline

        a = np.asarray((0, 0))
        b = np.asarray((1, 1))
        c = np.asarray((2, 2))
        tolerance = 0
        actual = points_inline(a, b, c, tolerance)
        self.assertTrue(actual)
Beispiel #5
0
    def test_points_inline_has_tolerence_but_point_is_beyond(self):
        import numpy as np
        from shapeanalysis.process_data import points_inline

        a = np.asarray((0, 0))
        b = np.asarray((-0.5, 1))
        c = np.asarray((0, 2))
        tolerance = 0.3
        actual = points_inline(a, b, c, tolerance)
        self.assertFalse(actual)
Beispiel #6
0
    def test_points_inline_negative_within_tolerance(self):
        import numpy as np
        from shapeanalysis.process_data import points_inline

        a = np.asarray((0, 0))
        b = np.asarray((-0.1, 1))
        c = np.asarray((0, 2))
        tolerance = 0.1
        actual = points_inline(a, b, c, tolerance)
        self.assertTrue(actual)