I'd like to access the vertex list of a mshr Polygon but I can't work out how to do so. My first attempt:
from dolfin import *
from mshr import *
poly = Polygon([Point(0,0), Point(1,0), Point(1,1), Point(0,0)])
[v for v in poly.vertices()]
results in
TypeError: 'SwigPyObject' object is not iterable
Attempting "poly.vertices()[0]" also fails:
TypeError: 'SwigPyObject' object has no attribute '__getitem__'
The only reasonable thing I can find on the object returned by vertices() is a next() function, but it just returns "None".
How can I get the vertices out of a polygon?