def test_from_regular_center(self):
for i in range(3, 13):
_poly = polygon2.Polygon2.from_regular(i, 1)
foundx0 = False
foundy0 = False
for p in _poly.points:
if math.isclose(p.x, 0, abs_tol=1e-07):
foundx0 = True
if foundy0:
break
if math.isclose(p.y, 0, abs_tol=1e-07):
foundy0 = True
if foundx0:
break
helpmsg = "\ni={}\nfoundx0={}, foundy0={}, center={}\nrepr={}\n\nstr={}".format(i, foundx0, foundy0, _poly.center, repr(_poly), str(_poly))
self.assertTrue(foundx0, msg=helpmsg)
self.assertTrue(foundy0, msg=helpmsg)
评论列表
文章目录