This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Creating an array of "Points"

0 votes

Is there anyway I can create a one dimensional array, of which each element of the array is given by Point(a,b) for some a,b?

I effectively want to automate the creation of a polygon P.

For example, say that X is a 2xN array, describing coordinates in R^2, given in anticlockwise order. I wish to create an array Y as follows:

for i in range(N):
    Y[i] = Point(X[i][0],X[i][1])

P = Polygon(Y)

So far I am having to do this by hand, i.e., writing an array of length N, and applying Polygon() to it.

Thanks in advance!

asked Dec 7, 2015 by ellya FEniCS Novice (170 points)
...