def test_intersectionSegmentPolygonSurface_miss(self): wall = pra.Wall([[0, 4, 4, 0], [0, 0, 4, 4], [0, 0, 0, 0]]) p, endOfSegment, onBorder = pra.geometry.intersection_segment_polygon_surface( [-1, -1, 2], [-1, -1, -2], wall.corners_2d, wall.normal, wall.plane_point, wall.plane_basis) i = p is None self.assertTrue(all([i, not endOfSegment, not onBorder]))
def test_intersectionSegmentPolygonSurface_touching(self): wall = pra.Wall([[0, 4, 4, 0], [0, 0, 4, 4], [0, 0, 0, 0]]) p, endOfSegment, onBorder = pra.geometry.intersection_segment_polygon_surface( [2, 2, 2], [2, 2, 0], wall.corners_2d, wall.normal, wall.plane_point, wall.plane_basis) i = all(p == [2, 2, 0]) self.assertTrue(all([i, endOfSegment, not onBorder]))