Во-первых, ваши операторы импорта неверны.
>>> from planar import Polygon, Point
>>>
>>> poly = Polygon([Point(0, 0),Point(1,0),Point(1, 1),Point(0, 1)])
>>>
Теперь сначала взглянем на приведенный ниже осмотр
>>> poly
Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
>>>
>>> for location in poly:
... print(location)
...
Vec2(0.00, 0.00)
Vec2(1.00, 0.00)
Vec2(1.00, 1.00)
Vec2(0.00, 1.00)
>>>
>>> for location in poly:
... print(dir(location))
... break
...
['__abs__', '__add__', '__bool__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__ifloordiv__', '__imul__', '__init__', '__init_subclass__', '__isub__', '__itruediv__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__neg__', '__new__', '__pos__', '__radd__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rmul__', '__rsub__', '__rtruediv__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', 'almost_equals', 'angle', 'angle_to', 'clamped', 'cross', 'distance_to', 'dot', 'is_null', 'length', 'length2', 'lerp', 'normalized', 'perpendicular', 'polar', 'project', 'reflect', 'rotated', 'scaled_to', 'x', 'y']
>>>
>>> for location in poly:
... print(location, location.x, location.y)
...
Vec2(0.00, 0.00) 0.0 0.0
Vec2(1.00, 0.00) 1.0 0.0
Vec2(1.00, 1.00) 1.0 1.0
Vec2(0.00, 1.00) 0.0 1.0
>>>
>>> # Create a rectangle => of height 5(y-axis), width 10(x-axis) with bottom left corner at origin (0, 0)
...
>>> rectangle = Polygon([Point(0, 0),Point(10,0),Point(10, 5),Point(0, 5)])
>>> rectangle
Polygon([(0, 0), (10, 0), (10, 5), (0, 5)])
>>>
>>> rectangle[0]
Vec2(0, 0)
>>>
>>> rectangle[0].x
0.0
>>> rectangle[0].y
0.0
>>>
>>> rectangle[1].x, rectangle[1].y
(10.0, 0.0)
>>>
Наконец, вы можете попробовать вот так
>>> # Create a reactangle of your choice i.e. at least with 1 co-ordinate (0.5, 0.5)
...
>>> rect = Polygon([Point(0, 0),Point(0.5, 0),Point(0.5, 0.5),Point(0, 0.5)])
>>> rect
Polygon([(0, 0), (0.5, 0), (0.5, 0.5), (0, 0.5)])
>>>
>>> found = False
>>> for vertex in rect:
... if vertex.x == 0.5 and vertex.y == 0.5:
... found = True
... break
...
>>> if found:
... print("Found a vertex with x=0.5, y=0.5")
... else:
... print("Couldn't find any vertex with x=0.5, y=0.5")
...
Found a vertex with x=0.5, y=0.5
>>>
>>>