def test_geometry_polygone(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") middle = GeometryPoint(GeometryPoint(0.5, 0.1)) poly = GeometryPolygone([GeometryPoint(0, 0), GeometryPoint(1, 0), GeometryPoint(1, 1), GeometryPoint(0, 1)]) r = poly.in_convex(middle) assert r out = GeometryPoint(0.5, -0.1) r = poly.in_convex(out) assert not r
def test_geometry_polygone2(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") poly = GeometryPolygone([GeometryPoint(0, 0), GeometryPoint(0, 1), GeometryPoint(1, 1), GeometryPoint(1, 0)]) convex = poly.convex() fLOG(convex) self.assertEqual(len(convex), len(poly)) r = [GeometryPoint(0, 1), GeometryPoint( 0, 0), GeometryPoint(1, 0), GeometryPoint(1, 1)] for p, e in zip(convex, r): self.assertEqual(p, e)
def test_geometry_polygone(self): fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__") middle = GeometryPoint(GeometryPoint(0.5, 0.1)) poly = GeometryPolygone([ GeometryPoint(0, 0), GeometryPoint(1, 0), GeometryPoint(1, 1), GeometryPoint(0, 1) ]) r = poly.in_convex(middle) assert r out = GeometryPoint(0.5, -0.1) r = poly.in_convex(out) assert not r
def test_geometry_polygone2(self): fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__") poly = GeometryPolygone([ GeometryPoint(0, 0), GeometryPoint(0, 1), GeometryPoint(1, 1), GeometryPoint(1, 0) ]) convex = poly.convex() fLOG(convex) self.assertEqual(len(convex), len(poly)) r = [ GeometryPoint(0, 1), GeometryPoint(0, 0), GeometryPoint(1, 0), GeometryPoint(1, 1) ] for p, e in zip(convex, r): self.assertEqual(p, e)