(self, points, point, expected_edge, expected_contains)
| 760 | self._proj_onto_axis_fuzzer(poly.points, _axis3, axisall.AxisAlignedLine(_axis3, 0, 1.41421356236)) |
| 761 | |
| 762 | def _contains_point_fuzzer(self, points, point, expected_edge, expected_contains): |
| 763 | for i in range(3): |
| 764 | offset = vector2.Vector2(random.uniform(-1000, 1000), random.uniform(-1000, 1000)) |
| 765 | |
| 766 | new_points = [] |
| 767 | for pt in points: |
| 768 | new_points.append(pt - offset) |
| 769 | |
| 770 | new_poly = polygon2.Polygon2(new_points) |
| 771 | |
| 772 | edge, cont = polygon2.Polygon2.contains_point(new_poly, offset, point) |
| 773 | |
| 774 | help_msg = "points={}, point={}, expected_edge={}, expected_contains={}, edge={}, cont={}".format(points, point, expected_edge, expected_contains, edge, cont) |
| 775 | self.assertEqual(expected_edge, edge, msg=help_msg) |
| 776 | self.assertEqual(expected_contains, cont, msg=help_msg) |
| 777 | |
| 778 | def test_contains_point_false(self): |
| 779 | poly = polygon2.Polygon2([ (1, 1), (2, 3), (4, 0) ]) |
no test coverage detected